Determining palette indices in palette-based video coding

ABSTRACT

In an example, a method of coding video data includes determining a first index value associated with a first pixel in a block of video data, wherein the first index value relates a position of the first pixel to an entry of a palette of pixel values, determining, based on the first index value, one or more second index values associated with one or more second pixels in the block of video data, wherein the second index values relate the positions of the one or more second pixels to one or more entries of the palette of pixel values, and coding the first pixel and the one or more second pixels of the block of video data.

This application claims the benefit of U.S. Provisional Application No.61/809,236, filed Apr. 5, 2013 and U.S. Provisional Application No.61/810,649, filed Apr. 10, 2013, the entire contents of which are eachincorporated herein by reference.

TECHNICAL FIELD

This disclosure relates to video encoding and decoding.

BACKGROUND

Digital video capabilities can be incorporated into a wide range ofdevices, including digital televisions, digital direct broadcastsystems, wireless broadcast systems, personal digital assistants (PDAs),laptop or desktop computers, tablet computers, e-book readers, digitalcameras, digital recording devices, digital media players, video gamingdevices, video game consoles, cellular or satellite radio telephones,so-called “smart phones,” video teleconferencing devices, videostreaming devices, and the like. Digital video devices implement videocompression techniques, such as those described in the standards definedby MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264/MPEG-4, Part 10, AdvancedVideo Coding (AVC), the High Efficiency Video Coding (HEVC) standardpresently under development, and extensions of such standards. The videodevices may transmit, receive, encode, decode, and/or store digitalvideo information more efficiently by implementing such videocompression techniques.

Video compression techniques perform spatial (intra-picture) predictionand/or temporal (inter-picture) prediction to reduce or removeredundancy inherent in video sequences. For block-based video coding, avideo slice (i.e., a video frame or a portion of a video frame) may bepartitioned into video blocks. Video blocks in an intra-coded (I) sliceof a picture are encoded using spatial prediction with respect toreference samples in neighboring blocks in the same picture. Videoblocks in an inter-coded (P or B) slice of a picture may use spatialprediction with respect to reference samples in neighboring blocks inthe same picture or temporal prediction with respect to referencesamples in other reference pictures. Pictures may be referred to asframes, and reference pictures may be referred to a reference frames.

Spatial or temporal prediction results in a predictive block for a blockto be coded. Residual data represents pixel differences between theoriginal block to be coded and the predictive block. An inter-codedblock is encoded according to a motion vector that points to a block ofreference samples forming the predictive block, and the residual dataindicates the difference between the coded block and the predictiveblock. An intra-coded block is encoded according to an intra-coding modeand the residual data. For further compression, the residual data may betransformed from the pixel domain to a transform domain, resulting inresidual coefficients, which then may be quantized. The quantizedcoefficients, initially arranged in a two-dimensional array, may bescanned in order to produce a one-dimensional vector of coefficients,and entropy coding may be applied to achieve even more compression.

A multiview coding bitstream may be generated by encoding views, e.g.,from multiple perspectives. Some three-dimensional (3D) video standardshave been developed that make use of multiview coding aspects. Forexample, different views may transmit left and right eye views tosupport 3D video. Alternatively, some 3D video coding processes mayapply so-called multiview plus depth coding. In multiview plus depthcoding, a 3D video bitstream may contain not only texture viewcomponents, but also depth view components. For example, each view maycomprise one texture view component and one depth view component.

SUMMARY

Techniques of this disclosure relate to palette-based video coding. Forexample, in palette based coding, a video coder (a video encoder orvideo decoder) may form a so-called “palette” as a table of colors forrepresenting the video data of the particular area (e.g., a givenblock). Palette-based coding may be especially useful for coding areasof video data having a relatively small number of colors. Rather thancoding actual pixel values (or their residuals), the video coder maycode index values for one or more of the pixels that relate the pixelswith entries in the palette representing the colors of the pixels. Apalette may be explicitly encoded and sent to the decoder, predictedfrom previous palette entries, or a combination thereof. The techniquesdescribed in this disclosure may include techniques for variouscombinations of one or more of signaling palette-based coding modes,coding palettes, predicting palettes, deriving palettes, and codingpalette-based coding maps and other syntax elements.

In one example, a method of coding video data includes determining afirst palette having first entries indicating first pixel values,determining, based on the first entries of the first palette, one ormore second entries indicating second pixel values of a second palette,and coding pixels of a block of video data using the second palette.

In another example, an apparatus for coding video data includes a memorystoring video data, and one or more processors configured to determine afirst palette having first entries indicating first pixel values,determine based on the first entries of the first palette, one or moresecond entries indicating second pixel values of a second palette, andcode pixels of a block of the video data using the second palette.

In another example, an apparatus for coding video data includes meansfor determining a first palette having first entries indicating firstpixel values, means for determining, based on the first entries of thefirst palette, one or more second entries indicating second pixel valuesof a second palette, and means for coding pixels of a block of videodata using the second palette.

In another example, a non-transitory computer-readable medium storesinstructions thereon that, when executed, cause one or more processorsto determine a first palette having first entries indicating first pixelvalues, determine based on the first entries of the first palette, oneor more second entries indicating second pixel values of a secondpalette, and code pixels of a block of the video data using the secondpalette.

In another example, a method of coding video data includes determining afirst index value associated with a first pixel in a block of videodata, wherein the first index value relates a position of the firstpixel to an entry of a palette of pixel values, determining, based onthe first index value, one or more second index values associated withone or more second pixels in the block of video data, wherein the secondindex values relate the positions of the one or more second pixels toone or more entries of the palette of pixel values, and coding the firstpixel and the one or more second pixels of the block of video data.

In another example, an apparatus for coding video data includes a memorystoring video data, and one or more processors configured to determine afirst index value associated with a first pixel in a block of the videodata, wherein the first index value relates a position of the firstpixel to an entry of a palette of pixel values, determine, based on thefirst index value, one or more second index values associated with oneor more second pixels in the block of video data, wherein the secondindex values relate the positions of the one or more second pixels toone or more entries of the palette of pixel values, and code the firstpixel and the one or more second pixels of the block of video data.

In another example, an apparatus for coding video data includes meansfor determining a first index value associated with a first pixel in ablock of video data, wherein the first index value relates a position ofthe first pixel to an entry of a palette of pixel values, means fordetermining, based on the first index value, one or more second indexvalues associated with one or more second pixels in the block of videodata, wherein the second index values relate the positions of the one ormore second pixels to one or more entries of the palette of pixelvalues, and means for coding the first pixel and the one or more secondpixels of the block of video data.

In another example, a non-transitory computer-readable medium storesinstructions thereon that, when executed, cause one or more processorsto determine a first index value associated with a first pixel in ablock of the video data, wherein the first index value relates aposition of the first pixel to an entry of a palette of pixel values,determine, based on the first index value, one or more second indexvalues associated with one or more second pixels in the block of videodata, wherein the second index values relate the positions of the one ormore second pixels to one or more entries of the palette of pixelvalues, and code the first pixel and the one or more second pixels ofthe block of video data.

The details of one or more examples of the disclosure are set forth inthe accompanying drawings and the description below. Other features,objects, and advantages will be apparent from the description, drawings,and claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating an example video coding systemthat may utilize the techniques described in this disclosure.

FIG. 2 is a block diagram illustrating an example video encoder that mayimplement the techniques described in this disclosure.

FIG. 3 is a block diagram illustrating an example video decoder that mayimplement the techniques described in this disclosure.

FIG. 4 is a conceptual diagram illustrating an example of determining apalette for coding video data, consistent with techniques of thisdisclosure.

FIG. 5 is a conceptual diagram illustrating an example of determiningindices to a palette for a block of pixels, consistent with techniquesof this disclosure.

FIG. 6 is a flowchart illustrating an example process for coding videodata using a palette coding mode, consistent with techniques of thisdisclosure.

FIG. 7 is a flowchart illustrating an example process for determining apalette in palette-based coding, consistent with techniques of thisdisclosure.

FIG. 8 is a flowchart illustrating an example process for determiningindices of a block of video data in palette-based video coding,consistent with techniques of this disclosure.

DETAILED DESCRIPTION

This disclosure includes techniques for video coding and compression. Inparticular, this disclosure describes techniques for palette-basedcoding of video data. In traditional video coding, images are assumed tobe continuous-tone and spatially smooth. Based on these assumptions,various tools have been developed such as block-based transform,filtering, etc., and such tools have shown good performance for naturalcontent videos.

However, in applications like remote desktop, collaborative work andwireless display, computer generated screen content (e.g., such as textor computer graphics) may be the dominant content to be compressed. Thistype of content tends to have discrete-tone and feature sharp lines, andhigh contrast object boundaries. The assumption of continuous-tone andsmoothness may no longer apply for screen content, and thus traditionalvideo coding techniques may not be efficient ways to compress video dataincluding screen content.

This disclosure describes palette-based coding, which may beparticularly suitable for screen generated content coding. For example,assuming a particular area of video data has a relatively small numberof colors. A video coder (a video encoder or video decoder) may form aso-called “palette” as a table of colors for representing the video dataof the particular area (e.g., a given block). Each pixel may beassociated with an entry in the palette that represents the color of thepixel. For example, the video coder may code an index that relates thepixel value to the appropriate value in the palette.

In the example above, a video encoder may encode a block of video databy determining a palette for the block (e.g., coding the paletteexplicitly, predicting it, or a combination thereof), locating an entryin the palette to represent the value of each pixel, and encoding theblock with index values for the pixels relating the pixel value to thepalette. A video decoder may obtain, from an encoded bitstream, apalette for a block, as well as index values for the pixels of theblock. The video decoder may relate the index values of the pixels toentries of the palette to reconstruct the pixel values of the block.

The example above is intended to provide a general description ofpalette-based coding. In various examples, the techniques described inthis disclosure may include techniques for various combinations of oneor more of signaling palette-based coding modes, transmitting palettes,predicting palettes, deriving palettes, and transmitting palette-basedcoding maps and other syntax elements. Such techniques may improve videocoding efficiency, e.g., requiring fewer bits to represent screengenerated content.

The techniques for palette-based coding of video data may be used withone or more other coding techniques, such as techniques for inter- orintra-predictive coding. For example, as described in greater detailbelow, an encoder or decoder, or combined encoder-decoder (codec), maybe configured to perform inter- and intra-predictive coding, as well aspalette-based coding.

In some examples, the palette-based coding techniques may be configuredfor use with one or more video coding standards. For example, HighEfficiency Video Coding (HEVC) is a new video coding standard developedby the Joint Collaboration Team on Video Coding (JCT-VC) of ITU-T VideoCoding Experts Group (VCEG) and ISO/IEC Motion Picture Experts Group(MPEG). A recent HEVC text specification draft is described in Bross etal., “High Efficiency Video Coding (HEVC) Text Specification Draft 10(for FDIS & Consent),” JCVC-L1003_v13, 12^(th) Meeting of JCT-VC ofITU-T SG16 WP 3 and ISO/IEC JCT 1/SC 29/WG 11, 14-23 Jan. 2013 (“HEVCDraft 10”), available from:http://phenix.int-evry.fr/jct/doc_end_user/documents/12_Geneva/wg11/JCTVC-L1003-v13.zip.

With respect to the HEVC framework, as an example, the palette-basedcoding techniques may be configured to be used as a coding unit (CU)mode. In other examples, the palette-based coding techniques may beconfigured to be used as a PU mode in the framework of HEVC.Accordingly, all of the following disclosed processes described in thecontext of a CU mode may, additionally or alternatively, apply to PU.However, these HEVC-based examples should not be considered arestriction or limitation of the palette-based coding techniquesdescribed herein, as such techniques may be applied to workindependently or as part of other existing or yet to be developedsystems/standards. In these cases, the unit for palette coding can besquare blocks, rectangular blocks or even regions of non-rectangularshape.

FIG. 1 is a block diagram illustrating an example video coding system 10that may utilize the techniques of this disclosure. As used herein, theterm “video coder” refers generically to both video encoders and videodecoders. In this disclosure, the terms “video coding” or “coding” mayrefer generically to video encoding or video decoding. Video encoder 20and video decoder 30 of video coding system 10 represent examples ofdevices that may be configured to perform techniques for palette-basedvideo coding in accordance with various examples described in thisdisclosure. For example, video encoder 20 and video decoder 30 may beconfigured to selectively code various blocks of video data, such asCU's or PU's in HEVC coding, using either palette-based coding ornon-palette based coding. Non-palette based coding modes may refer tovarious inter-predictive temporal coding modes or intra-predictivespatial coding modes, such as the various coding modes specified by HEVCDraft 10.

As shown in FIG. 1, video coding system 10 includes a source device 12and a destination device 14. Source device 12 generates encoded videodata. Accordingly, source device 12 may be referred to as a videoencoding device or a video encoding apparatus. Destination device 14 maydecode the encoded video data generated by source device 12.Accordingly, destination device 14 may be referred to as a videodecoding device or a video decoding apparatus. Source device 12 anddestination device 14 may be examples of video coding devices or videocoding apparatuses.

Source device 12 and destination device 14 may comprise a wide range ofdevices, including desktop computers, mobile computing devices, notebook(e.g., laptop) computers, tablet computers, set-top boxes, telephonehandsets such as so-called “smart” phones, televisions, cameras, displaydevices, digital media players, video gaming consoles, in-car computers,or the like.

Destination device 14 may receive encoded video data from source device12 via a channel 16. Channel 16 may comprise one or more media ordevices capable of moving the encoded video data from source device 12to destination device 14. In one example, channel 16 may comprise one ormore communication media that enable source device 12 to transmitencoded video data directly to destination device 14 in real-time. Inthis example, source device 12 may modulate the encoded video dataaccording to a communication standard, such as a wireless communicationprotocol, and may transmit the modulated video data to destinationdevice 14. The one or more communication media may include wirelessand/or wired communication media, such as a radio frequency (RF)spectrum or one or more physical transmission lines. The one or morecommunication media may form part of a packet-based network, such as alocal area network, a wide-area network, or a global network (e.g., theInternet). The one or more communication media may include routers,switches, base stations, or other equipment that facilitatecommunication from source device 12 to destination device 14.

In another example, channel 16 may include a storage medium that storesencoded video data generated by source device 12. In this example,destination device 14 may access the storage medium via disk access orcard access. The storage medium may include a variety oflocally-accessed data storage media such as Blu-ray discs, DVDs,CD-ROMs, flash memory, or other suitable digital storage media forstoring encoded video data.

In a further example, channel 16 may include a file server or anotherintermediate storage device that stores encoded video data generated bysource device 12. In this example, destination device 14 may accessencoded video data stored at the file server or other intermediatestorage device via streaming or download. The file server may be a typeof server capable of storing encoded video data and transmitting theencoded video data to destination device 14. Example file serversinclude web servers (e.g., for a website), file transfer protocol (FTP)servers, network attached storage (NAS) devices, and local disk drives.

Destination device 14 may access the encoded video data through astandard data connection, such as an Internet connection. Example typesof data connections may include wireless channels (e.g., Wi-Ficonnections), wired connections (e.g., DSL, cable modem, etc.), orcombinations of both that are suitable for accessing encoded video datastored on a file server. The transmission of encoded video data from thefile server may be a streaming transmission, a download transmission, ora combination of both.

The techniques of this disclosure are not limited to wirelessapplications or settings. The techniques may be applied to video codingin support of a variety of multimedia applications, such as over-the-airtelevision broadcasts, cable television transmissions, satellitetelevision transmissions, streaming video transmissions, e.g., via theInternet, encoding of video data for storage on a data storage medium,decoding of video data stored on a data storage medium, or otherapplications. In some examples, video coding system 10 may be configuredto support one-way or two-way video transmission to support applicationssuch as video streaming, video playback, video broadcasting, and/orvideo telephony.

FIG. 1 is merely an example and the techniques of this disclosure mayapply to video coding settings (e.g., video encoding or video decoding)that do not necessarily include any data communication between theencoding and decoding devices. In other examples, data is retrieved froma local memory, streamed over a network, or the like. A video encodingdevice may encode and store data to memory, and/or a video decodingdevice may retrieve and decode data from memory. In many examples, theencoding and decoding is performed by devices that do not communicatewith one another, but simply encode data to memory and/or retrieve anddecode data from memory.

In the example of FIG. 1, source device 12 includes a video source 18, avideo encoder 20, and an output interface 22. In some examples, outputinterface 22 may include a modulator/demodulator (modem) and/or atransmitter. Video source 18 may include a video capture device, e.g., avideo camera, a video archive containing previously-captured video data,a video feed interface to receive video data from a video contentprovider, and/or a computer graphics system for generating video data,or a combination of such sources of video data.

Video encoder 20 may encode video data from video source 18. In someexamples, source device 12 directly transmits the encoded video data todestination device 14 via output interface 22. In other examples, theencoded video data may also be stored onto a storage medium or a fileserver for later access by destination device 14 for decoding and/orplayback.

In the example of FIG. 1, destination device 14 includes an inputinterface 28, a video decoder 30, and a display device 32. In someexamples, input interface 28 includes a receiver and/or a modem. Inputinterface 28 may receive encoded video data over channel 16. Displaydevice 32 may be integrated with or may be external to destinationdevice 14. In general, display device 32 displays decoded video data.Display device 32 may comprise a variety of display devices, such as aliquid crystal display (LCD), a plasma display, an organic lightemitting diode (OLED) display, or another type of display device.

This disclosure may generally refer to video encoder 20 “signaling” or“transmitting” certain information to another device, such as videodecoder 30. The term “signaling” or “transmitting” may generally referto the communication of syntax elements and/or other data used to decodethe compressed video data. Such communication may occur in real- ornear-real-time. Alternately, such communication may occur over a span oftime, such as might occur when storing syntax elements to acomputer-readable storage medium in an encoded bitstream at the time ofencoding, which then may be retrieved by a decoding device at any timeafter being stored to this medium. Thus, while video decoder 30 may bereferred to as “receiving” certain information, the receiving ofinformation does not necessarily occur in real- or near-real-time andmay be retrieved from a medium at some time after storage.

Video encoder 20 and video decoder 30 each may be implemented as any ofa variety of suitable circuitry, such as one or more microprocessors,digital signal processors (DSPs), application-specific integratedcircuits (ASICs), field-programmable gate arrays (FPGAs), discretelogic, hardware, or any combinations thereof. If the techniques areimplemented partially in software, a device may store instructions forthe software in a suitable, non-transitory computer-readable storagemedium and may execute the instructions in hardware using one or moreprocessors to perform the techniques of this disclosure. Any of theforegoing (including hardware, software, a combination of hardware andsoftware, etc.) may be considered to be one or more processors. Each ofvideo encoder 20 and video decoder 30 may be included in one or moreencoders or decoders, either of which may be integrated as part of acombined encoder/decoder (CODEC) in a respective device.

In some examples, video encoder 20 and video decoder 30 operateaccording to a video compression standard, such as HEVC standardmentioned above, and described in HEVC Draft 10. In addition to the baseHEVC standard, there are ongoing efforts to produce scalable videocoding, multiview video coding, and 3D coding extensions for HEVC. Inaddition, palette-based coding modes, e.g., as described in thisdisclosure, may be provided for extension of the HEVC standard. In someexamples, the techniques described in this disclosure for palette-basedcoding may be applied to encoders and decoders configured to operationaccording to other video coding standards, such as the ITU-T-H.264/AVCstandard or future standards. Accordingly, application of apalette-based coding mode for coding of coding units (CU's) orprediction units (PU's) in an HEVC codec is described for purposes ofexample.

In HEVC and other video coding standards, a video sequence typicallyincludes a series of pictures. Pictures may also be referred to as“frames.” A picture may include three sample arrays, denoted S_(L),S_(Cb) and S_(Cr). S_(L) is a two-dimensional array (i.e., a block) ofluma samples. S_(Cb) is a two-dimensional array of Cb chrominancesamples. S_(Cr) is a two-dimensional array of Cr chrominance samples.Chrominance samples may also be referred to herein as “chroma” samples.In other instances, a picture may be monochrome and may only include anarray of luma samples.

To generate an encoded representation of a picture, video encoder 20 maygenerate a set of coding tree units (CTUs). Each of the CTUs may be acoding tree block of luma samples, two corresponding coding tree blocksof chroma samples, and syntax structures used to code the samples of thecoding tree blocks. A coding tree block may be an N×N block of samples.A CTU may also be referred to as a “tree block” or a “largest codingunit” (LCU). The CTUs of HEVC may be broadly analogous to themacroblocks of other standards, such as H.264/AVC. However, a CTU is notnecessarily limited to a particular size and may include one or morecoding units (CUs). A slice may include an integer number of CTUsordered consecutively in the raster scan.

coded slice may comprise a slice header and slice data. The slice headerof a slice may be a syntax structure that includes syntax elements thatprovide information about the slice. The slice data may include codedCTUs of the slice.

This disclosure may use the term “video unit” or “video block” or“block” to refer to one or more sample blocks and syntax structures usedto code samples of the one or more blocks of samples. Example types ofvideo units or blocks may include CTUs, CUs, PUs, transform units (TUs),macroblocks, macroblock partitions, and so on. In some contexts,discussion of PUs may be interchanged with discussion of macroblocks ofmacroblock partitions.

To generate a coded CTU, video encoder 20 may recursively performquad-tree partitioning on the coding tree blocks of a CTU to divide thecoding tree blocks into coding blocks, hence the name “coding treeunits.” A coding block is an N×N block of samples. A CU may be a codingblock of luma samples and two corresponding coding blocks of chromasamples of a picture that has a luma sample array, a Cb sample array anda Cr sample array, and syntax structures used to code the samples of thecoding blocks. Video encoder 20 may partition a coding block of a CUinto one or more prediction blocks. A prediction block may be arectangular (i.e., square or non-square) block of samples on which thesame prediction is applied. A prediction unit (PU) of a CU may be aprediction block of luma samples, two corresponding prediction blocks ofchroma samples of a picture, and syntax structures used to predict theprediction block samples. Video encoder 20 may generate predictive luma,Cb and Cr blocks for luma, Cb and Cr prediction blocks of each PU of theCU.

Video encoder 20 may use intra prediction or inter prediction togenerate the predictive blocks for a PU. If video encoder 20 uses intraprediction to generate the predictive blocks of a PU, video encoder 20may generate the predictive blocks of the PU based on decoded samples ofthe picture associated with the PU.

If video encoder 20 uses inter prediction to generate the predictiveblocks of a PU, video encoder 20 may generate the predictive blocks ofthe PU based on decoded samples of one or more pictures other than thepicture associated with the PU. Video encoder 20 may use uni-predictionor bi-prediction to generate the predictive blocks of a PU. When videoencoder 20 uses uni-prediction to generate the predictive blocks for aPU, the PU may have a single MV. When video encoder 20 usesbi-prediction to generate the predictive blocks for a PU, the PU mayhave two MVs.

After video encoder 20 generates predictive luma, Cb and Cr blocks forone or more PUs of a CU, video encoder 20 may generate a luma residualblock for the CU. Each sample in the CU's luma residual block indicatesa difference between a luma sample in one of the CU's predictive lumablocks and a corresponding sample in the CU's original luma codingblock. In addition, video encoder 20 may generate a Cb residual blockfor the CU. Each sample in the CU's Cb residual block may indicate adifference between a Cb sample in one of the CU's predictive Cb blocksand a corresponding sample in the CU's original Cb coding block. Videoencoder 20 may also generate a Cr residual block for the CU. Each samplein the CU's Cr residual block may indicate a difference between a Crsample in one of the CU's predictive Cr blocks and a correspondingsample in the CU's original Cr coding block.

Furthermore, video encoder 20 may use quad-tree partitioning todecompose the luma, Cb and Cr residual blocks of a CU into one or moreluma, Cb and Cr transform blocks. A transform block may be a rectangularblock of samples on which the same transform is applied. A transformunit (TU) of a CU may be a transform block of luma samples, twocorresponding transform blocks of chroma samples, and syntax structuresused to transform the transform block samples. Thus, each TU of a CU maybe associated with a luma transform block, a Cb transform block, and aCr transform block. The luma transform block associated with the TU maybe a sub-block of the CU's luma residual block. The Cb transform blockmay be a sub-block of the CU's Cb residual block. The Cr transform blockmay be a sub-block of the CU's Cr residual block.

Video encoder 20 may apply one or more transforms to a luma transformblock of a TU to generate a luma coefficient block for the TU. Acoefficient block may be a two-dimensional array of transformcoefficients. A transform coefficient may be a scalar quantity. Videoencoder 20 may apply one or more transforms to a Cb transform block of aTU to generate a Cb coefficient block for the TU. Video encoder 20 mayapply one or more transforms to a Cr transform block of a TU to generatea Cr coefficient block for the TU.

After generating a coefficient block (e.g., a luma coefficient block, aCb coefficient block or a Cr coefficient block), video encoder 20 mayquantize the coefficient block. Quantization generally refers to aprocess in which transform coefficients are quantized to possibly reducethe amount of data used to represent the transform coefficients,providing further compression. After video encoder 20 quantizes acoefficient block, video encoder 20 may entropy encoding syntax elementsindicating the quantized transform coefficients. For example, videoencoder 20 may perform Context-Adaptive Binary Arithmetic Coding (CABAC)on the syntax elements indicating the quantized transform coefficients.Video encoder 20 may output the entropy-encoded syntax elements in abitstream.

Video encoder 20 may output a bitstream that includes theentropy-encoded syntax elements. The bitstream may include a sequence ofbits that forms a representation of coded pictures and associated data.The bitstream may comprise a sequence of network abstraction layer (NAL)units. Each of the NAL units includes a NAL unit header and encapsulatesa raw byte sequence payload (RBSP). The NAL unit header may include asyntax element that indicates a NAL unit type code. The NAL unit typecode specified by the NAL unit header of a NAL unit indicates the typeof the NAL unit. A RBSP may be a syntax structure containing an integernumber of bytes that is encapsulated within a NAL unit. In someinstances, an RBSP includes zero bits.

Different types of NAL units may encapsulate different types of RBSPs.For example, a first type of NAL unit may encapsulate an RBSP for apicture parameter set (PPS), a second type of NAL unit may encapsulatean RBSP for a coded slice, a third type of NAL unit may encapsulate anRBSP for SEI, and so on. NAL units that encapsulate RBSPs for videocoding data (as opposed to RBSPs for parameter sets and SEI messages)may be referred to as video coding layer (VCL) NAL units.

Video decoder 30 may receive a bitstream generated by video encoder 20.In addition, video decoder 30 may parse the bitstream to decode syntaxelements from the bitstream. Video decoder 30 may reconstruct thepictures of the video data based at least in part on the syntax elementsdecoded from the bitstream. The process to reconstruct the video datamay be generally reciprocal to the process performed by video encoder20.

For instance, video decoder 30 may use MVs of PUs to determinepredictive sample blocks for the PUs of a current CU. In addition, videodecoder 30 may inverse quantize transform coefficient blocks associatedwith TUs of the current CU. Video decoder 30 may perform inversetransforms on the transform coefficient blocks to reconstruct transformblocks associated with the TUs of the current CU. Video decoder 30 mayreconstruct the coding blocks of the current CU by adding the samples ofthe predictive sample blocks for PUs of the current CU to correspondingsamples of the transform blocks of the TUs of the current CU. Byreconstructing the coding blocks for each CU of a picture, video decoder30 may reconstruct the picture.

In some examples, video encoder 20 and video decoder 30 may beconfigured to perform palette-based coding. For example, in palettebased coding, rather than performing the intra-predictive orinter-predictive coding techniques described above, video encoder 20 andvideo decoder 30 may code a so-called palette as a table of colors forrepresenting the video data of the particular area (e.g., a givenblock). Each pixel may be associated with an entry in the palette thatrepresents the color of the pixel. For example, video encoder 20 andvideo decoder 30 may code an index that relates the pixel value to theappropriate value in the palette.

In the example above, video encoder 20 may encode a block of video databy determining a palette for the block, locating an entry in the paletteto represent the value of each pixel, and encoding the palette withindex values for the pixels relating the pixel value to the palette.Video decoder 30 may obtain, from an encoded bitstream, a palette for ablock, as well as index values for the pixels of the block. Videodecoder 30 may relate the index values of the pixels to entries of thepalette to reconstruct the pixel values of the block.

Palette-based coding may have a certain amount of signaling overhead.For example, a number of bits may be needed to signal characteristics ofa palette, such as a size of the palette, as well as the palette itself.In addition, a number of bits may be needed to signal index values forthe pixels of the block. The techniques of this disclosure may, in someexamples, reduce the number of bits needed to signal such information.For example, the techniques described in this disclosure may includetechniques for various combinations of one or more of signalingpalette-based coding modes, transmitting palettes, predicting palettes,deriving palettes, and transmitting palette-based coding maps and othersyntax elements.

Aspects of this disclosure are directed to palette prediction. Forexample, according to aspects of this disclosure, video encoder 20and/or video decoder 30 may determine a first palette having firstentries indicating first pixel values. Video encoder 20 and/or videodecoder 30 may then determine, based on the first entries of the firstpalette, one or more second entries indicating second pixel values of asecond palette. Video encoder 20 and/or video decoder 30 may also codepixels of a block of video data using the second palette.

When determining the second entries of the second palette based on thefirst entries, video encoder 20 may encode a variety of syntax elements,which may be used by video decoder to reconstruct the second palette.For example, video encoder 20 may encode one or more syntax elements ina bitstream to indicate that an entire palette (or palettes, in the caseof each color component, e.g., Y, Cb, Cr, or Y, U, V, or R, G, B, of thevideo data having a separate palette) is copied from one or moreneighboring blocks of the block currently being coded. The palette fromwhich entries of the current palette of the current block are predicted(e.g., copied) may be referred to as a predictive palette. Thepredictive palette may contain palette entries from one or moreneighboring blocks including spatially neighboring blocks and/orneighboring blocks in a particular scan order of the blocks. Forexample, the neighboring blocks may be spatially located to the left(left neighboring block) of or above (upper neighboring block) the blockcurrently being coded. In another example, video encoder 20 maydetermine predictive palette entries using the most frequent samplevalues in a causal neighbor of the current block. In another example,the neighboring blocks may neighbor the block current being codedaccording to a particular scan order used to code the blocks. That is,the neighboring blocks may be one or more blocks coded prior to thecurrent block in the scan order. Video encoder 20 may encode one or moresyntax elements to indicate the location of the neighboring blocks fromwhich the palette(s) are copied.

In some examples, palette prediction may be performed entry-wise. Forexample, video encoder 20 may encode one or more syntax elements toindicate, for each entry of a predictive palette, whether the paletteentry is included in the palette for the current block. If video encoder20 does not predict an entry of the palette for the current block, videoencoder 20 may encode one or more additional syntax elements to specifythe non-predicted entries, as well as the number of such entries.

In some examples, techniques for predicting an entire palette may becombined with techniques for predicting one or more entries of apalette. For example, video encoder 20 may encode one or more syntaxelements in a bitstream to indicate whether the current palette isentirely copied from the predictive palette. If this is not the case,video encoder 20 may encode one or more syntax elements in a bitstreamto indicate whether each entry in the predictive palette is copied.

In another example, instead of signaling the number of entries and thepalette value, video encoder 20 may signal, after signaling each palettevalue, a flag to indicate whether the signaled palette value is thefinal palette entry for the palette. Video encoder 20 may not signalsuch an “end of palette” flag if the palette has already reached acertain maximum size.

According to aspects of this disclosure, video encoder 20 may encode oneor more syntax elements to indicate whether palette prediction isenabled and/or active. In an example for purposes of illustration, videoencoder 20 may encode a pred_palette_flag to indicate, for each block(e.g., CU or PU), whether video encoder 20 uses palette prediction topredict the palette for the respective block. In some examples, videoencoder may signal a separate flag for each color component (e.g., threeflags for each block). In other examples, video encoder 20 may signal asingle flag that is applicable to all color components of a block.

Video decoder 30 may obtain the above-identified information from anencoded bitstream and use the data to reconstruct the palette. Forexample, video decoder 30 may receive data indicating whether aparticular palette is predicted from another palette, as well asinformation that allows video decoder 30 to use the appropriatepredictive palette entries.

In some instances, additionally or alternatively, video encoder 20and/or video decoder 30 may construct a palette on-the-fly, i.e.,dynamically. For example, video encoder 20 and/or video decoder 30 mayadd entries to an empty palette during coding. That is, video encoder 20may add pixel values to a palette as the pixel values are generated andtransmitted for positions in a block. Pixels that are coded relativelylater in the block may refer to earlier added entries of the palette,e.g., with index values, instead of transmitting the pixel values.Likewise, upon receiving a new pixel value for a position in a block,video decoder 30 may follow the same process as video encoder 20 andinclude the pixel value in a palette. In this way, video decoder 30constructs the same palette as video encoder 20. Video decoder 30 mayreceive, for pixels having values that are already included in thepalette, index values that identify the values. Video decoder 30 may usethe received information, e.g., pixel values for the palette and indexvalues, to reconstruct the pixels of a block.

In some instances, video encoder 20 and video decoder 30 may maintain apalette of a fixed size. For example, video encoder 20 and video decoder30 may add the most recent reconstructed pixel values the palette as arereconstructed. For each entry that is added to the palette, the entrythat was added to the palette the earliest is discarded. This is alsosometimes referred to as First-in-First-out (FIFO). This process ofupdating the palette may be applied only to blocks that are coded usingthe palette mode or to all the blocks irrespective of the coding mode.

The techniques described above generally relate to video encoder 20 andvideo decoder 30 constructing and/or transmitting a palette forpalette-based coding. Other aspects of this disclosure relate toconstructing and/or transmitting a map that allows video encoder 20and/or video decoder 30 to determine pixel values. For example, otheraspects of this disclosure relate constructing and/or transmitting a mapof indices that relate a particular pixel to an entry of a palette.

In some examples, video encoder 20 may indicate whether pixels of ablock have a corresponding value in a palette. In an example forpurposes of illustration, assume that an (i, j) entry of a mapcorresponds to an (i, j) pixel position in a block of video data. Inthis example, video encoder 20 may encode a flag for each pixel positionof a block. Video encoder 20 may set the flag equal to one for the (i,j) entry to indicate that the pixel value at the (i, j) location is oneof the values in the palette. When a color is included in the palette(i.e., the flag is equal to one) video encoder 20 may also encode dataindicating a palette index for the (i, j) entry that identifies thecolor in the palette. When the color of the pixel is not included in thepalette (i.e., the flag is equal to zero) video encoder 20 may alsoencode data indicating a sample value for the pixel. Video decoder 30may obtain the above-described data from an encoded bitstream and usethe data to determine a palette index and/or pixel value for aparticular location in a block.

In some instances, there may be a correlation between the palette indexto which a pixel at a given position is mapped and the probability of aneighboring pixel being mapped to the same palette index. That is, whena pixel is mapped to a particular palette index, the probability may berelatively high that one or more neighboring pixels (in terms of spatiallocation) are mapped to the same palette index.

According to aspects of this disclosure, video encoder 20 and/or videodecoder 30 may determine and code one or more indices of a block ofvideo data relative to one or more indices of the same block of videodata. For example, video encoder 20 and/or video decoder 30 may beconfigured to determine a first index value associated with a firstpixel in a block of video data, where the first index value relates avalue of the first pixel to an entry of a palette. Video encoder 20and/or video decoder 30 may also be configured to determine, based onthe first index value, one or more second index values associated withone or more second pixels in the block of video data, and to code thefirst and the one or more second pixels of the block of video data.Thus, in this example, indices of a map may be coded relative to one ormore other indices of the map.

In some examples, video encoder 20 may encode one or more syntaxelements indicating a number of consecutive pixels in a given scan orderthat are mapped to the same index value. The string of like-valued indexvalues may be referred to herein as a “run.” In some examples, a pixelvalue may be associated with exactly one index value in a palette.Accordingly, in some instances, a run of values may also refer to astring of like-valued pixel values. In other examples, as described withrespect to lossy coding below, more than one pixel value may map to thesame index value in a palette. In such examples, a run of values refersto like-valued index values.

In an example for purposes of illustration, if two consecutive indicesin a given scan order have different values, the run is equal to zero.If two consecutive indices in a given scan order have the same value butthe third index in the scan order has a different value, the run isequal to one. Video decoder 30 may obtain the syntax elements indicatinga run from an encoded bitstream and use the data to determine the numberof consecutive pixel locations that have the same index value.

Additionally or alternatively, according to aspects of this disclosure,video encoder 20 and video decoder 30 may perform line copying for oneor more entries of a map. The entries may also be referred to as“positions” due to the relationship between entries of the map and pixelpositions of a block. The line copying may depend, in some examples, onthe scan direction. For example, video encoder 20 may indicate that apixel value or index map value for a particular position in a block isequal to the pixel or index value in a line above the particularposition (for a horizontal scan) or the column to the left of theparticular position (for a vertical scan). Video encoder 20 may alsoindicate, as a run, the number of pixel values or indices in the scanorder that are equal to the corresponding pixel values or indices aboveor the column to the left of the particular position. In this example,video encoder 20 and or video decoder 30 may copy pixel or index valuesfrom the specified neighboring line and from the specified number ofentries for the line of the block currently being coded.

In some instances, the line from which values are copied may be directlyadjacent to, e.g., above or to the left of, the line of the positioncurrently being coded. In other examples, a number of lines of the blockmay be buffered by video encoder 20 and/or video decoder 30, such thatany of the number of lines of the map may be used as predictive valuesfor a line of the map currently being coded. In an example for purposesof illustration, video encoder 20 and/or video decoder 30 may beconfigured to store the previous four rows of indices or pixel valuesprior to coding the current row of pixels. In this example, thepredictive row (the row from which indices or pixel values are copied)may be indicated in a bitstream with a truncated unary code or othercodes such as unary codes. With respect to a truncated unary code, videoencoder 20 and/or video decoder 30 may determine a maximum value for thetruncated unary code based on a maximum row calculation (e.g.,row_index−1) or a maximum column calculation (e.g., column_index−1). Inaddition, an indication of the number of positions from the predictiverow that are copied may also be included in the bitstream. In someinstances, if the line or column from which a current position is beingpredicted belongs to another block (e.g., CU or CTU) such prediction maybe disabled.

According to aspects of this disclosure, the techniques for codingso-called runs of entries may be used in conjunction with the techniquesfor line copying described above. For example, video encoder 20 mayencode one or more syntax elements (e.g., a flag) indicating whether thevalue of an entry in a map is obtained from a palette or the value of anentry in the map is obtained from a previously coded line in the map.Video encoder 20 may also encode one or more syntax elements indicatingan index value of a palette or the location of the entry in the line(the row or column). Video encoder 20 may also encode one or more syntaxelements indicating a number of consecutive entries that share the samevalue. Video decoder 30 may obtain such information from an encodedbitstream and use the information to reconstruct the map and pixelvalues for a block.

As noted above, the indices of a map are scanned in a particular order.According to aspects of this disclosure, the scan direction may bevertical, horizontal, or at a diagonal (e.g., 45 degrees or 135 degreesdiagonally in block). In some examples, video encoder 20 may encode oneor more syntax elements for each block indicating a scan direction forscanning the indices of the block. Additionally or alternatively, thescan direction may be signaled or inferred based on so-called sideinformation such as, for example, block size, color space, and/or colorcomponent. Video encoder 20 may specify scans for each color componentof a block. Alternatively, a specified scan may apply to all colorcomponents of a block.

The techniques of this disclosure also include other aspects ofpalette-based coding. For example, according to aspects of thisdisclosure, video encoder 20 and/or video decoder 30 may code one ormore syntax elements for each block to indicate that the block is codedusing a palette coding mode. For example, video encoder 20 and/or videodecoder 30 may code a palette mode flag (PLT_Mode_flag) to indicatewhether a palette-based coding mode is to be used for coding aparticular block. In this example, video encoder 20 may encode aPLT_Mode_flag that is equal to one to specify that the block currentlybeing encoded (“current block”) is encoded using a palette mode. A valueof the PLT_Mode_flag equal to zero specifies that the current block isnot encoded using palette mode. In this case, video decoder 30 mayobtain the PLT_Mode_flag from the encoded bitstream and apply thepalette-based coding mode to decode the block. In instances in whichthere is more than one palette-based coding mode available (e.g., thereis more than one palette-based technique available for coding) one ormore syntax elements may indicate one of a plurality of differentpalette modes for the block.

In some instances, video encoder 20 may encode a PLT_Mode_flag that isequal to zero to specify that the current block is not encoded using apalette mode. In such instances, video encoder 20 may encode the blockusing any of a variety of inter-predictive, intra-predictive, or othercoding modes. When the PLT_Mode_flag is equal to zero, video encoder 20may transmit additional information (e.g., syntax elements) to indicatethe specific mode that is used for encoding the respective block. Insome examples, as described below, the mode may be an HEVC coding mode.The use of the PLT_Mode_flag is described for purposes of example. Inother examples, other syntax elements such as multi-bit codes may beused to indicate whether the palette-based coding mode is to be used forone or more blocks, or to indicate which of a plurality of modes are tobe used.

When a palette-based coding mode is used, a palette is transmitted byvideo encoder 20, e.g., using one or more of the techniques describedherein, in the encoded video data bitstream for use by video decoder 30.A palette may be transmitted for each block or may be shared among anumber of blocks. The palette may refer to a number of pixel values thatare dominant and/or representative for the block.

According to aspects of this disclosure, the size of the palette, e.g.,in terms of the number of pixel values that are included in the palette,may be fixed or may be signaled using one or more syntax elements in anencoded bitstream. As described in greater detail below, a pixel valuemay be composed of a number of samples, e.g., depending on the colorspace used for coding. For example, a pixel value may include luma andchrominance samples (e.g., luma, U chrominance and V chrominance (YUV)or luma, Cb chrominance, and Cr chrominance (YCbCr) samples). In anotherexample, a pixel value may include Red, Green, and Blue (RGB) samples.As described herein, the term pixel value may generally refer to one ormore of the samples contributing to a pixel. That is, the term pixelvalue does not necessarily refer to all samples contributing to a pixel,and may be used to describe a single sample value contributing to apixel.

According to aspects of this disclosure, a palette may be transmittedseparately for each color component of a particular block. For example,in the YUV color space, there may be a palette for the Y component(representing Y values), another palette for the U component(representing U values), and yet another palette for the V component(representing V values). In another example, a palette may include allcomponents of a particular block. In this example, the i-th entry in thepalette may include three values (e.g., Yi, Ui, Vi). According toaspects of this disclosure, one or more syntax elements may separatelyindicate the size of the palette for each component (e.g., Y, U, V, orthe like). In other examples, a single size may be used for allcomponents, such that one or more syntax elements indicate the size ofall components.

According to aspects of this disclosure, video encoder 20 and/or videodecoder may perform palette-based coding in a lossy or lossless manner.That is, in some examples, video encoder 20 and/or video decoder 30 maylosslessly code video data for a block using palette entries that matchthe pixel values of the block (or by sending the actual pixel values ifthe pixel value is not included in the palette). In other examples, asdescribed in greater detail with respect to FIG. 5 below, video encoder20 and/or video decoder 30 may code video data for a block using paletteentries that do not exactly match the pixel values of the block (lossycoding).

In some examples, the techniques for palette-based coding of video datamay be used with one or more other coding techniques, such as techniquesfor inter- or intra-predictive coding. For example, as described ingreater detail below, an encoder or decoder, or combined encoder-decoder(codec), may be configured to perform inter- and intra-predictivecoding, as well as palette-based coding.

FIG. 2 is a block diagram illustrating an example video encoder 20 thatmay implement the techniques of this disclosure. FIG. 2 is provided forpurposes of explanation and should not be considered limiting of thetechniques as broadly exemplified and described in this disclosure. Forpurposes of explanation, this disclosure describes video encoder 20 inthe context of HEVC coding. However, the techniques of this disclosuremay be applicable to other coding standards or methods.

Video encoder 20 represents an example of a device that may beconfigured to perform techniques for palette-based video coding inaccordance with various examples described in this disclosure. Forexample, video encoder 20 may be configured to selectively code variousblocks of video data, such as CU's or PU's in HEVC coding, using eitherpalette-based coding or non-palette based coding. Non-palette basedcoding modes may refer to various inter-predictive temporal coding modesor intra-predictive spatial coding modes, such as the various codingmodes specified by HEVC Draft 10. Video encoder 20, in one example, maybe configured to generate a palette having entries indicating pixelvalues, select pixel values in a palette to represent pixel values of atleast some positions of a block of video data, and signal informationassociating at least some of the positions of the block of video datawith entries in the palette corresponding, respectively, to the selectedpixel values. The signaled information may be used by video decoder 30to decode video data.

In the example of FIG. 2, video encoder 20 includes a predictionprocessing unit 100, a residual generation unit 102, a transformprocessing unit 104, a quantization unit 106, an inverse quantizationunit 108, an inverse transform processing unit 110, a reconstructionunit 112, a filter unit 114, a decoded picture buffer 116, and anentropy encoding unit 118. Prediction processing unit 100 includes aninter-prediction processing unit 120 and an intra-prediction processingunit 126. Inter-prediction processing unit 120 includes a motionestimation unit and a motion compensation unit (not shown). Videoencoder 20 also includes a palette-based encoding unit 122 configured toperform various aspects of the palette-based coding techniques describedin this disclosure. In other examples, video encoder 20 may includemore, fewer, or different functional components.

Video encoder 20 may receive video data. Video encoder 20 may encodeeach CTU in a slice of a picture of the video data. Each of the CTUs maybe associated with equally-sized luma coding tree blocks (CTBs) andcorresponding CTBs of the picture. As part of encoding a CTU, predictionprocessing unit 100 may perform quad-tree partitioning to divide theCTBs of the CTU into progressively-smaller blocks. The smaller block maybe coding blocks of CUs. For example, prediction processing unit 100 maypartition a CTB associated with a CTU into four equally-sizedsub-blocks, partition one or more of the sub-blocks into fourequally-sized sub-sub-blocks, and so on.

Video encoder 20 may encode CUs of a CTU to generate encodedrepresentations of the CUs (i.e., coded CUs). As part of encoding a CU,prediction processing unit 100 may partition the coding blocksassociated with the CU among one or more PUs of the CU. Thus, each PUmay be associated with a luma prediction block and corresponding chromaprediction blocks. Video encoder 20 and video decoder 30 may support PUshaving various sizes. As indicated above, the size of a CU may refer tothe size of the luma coding block of the CU and the size of a PU mayrefer to the size of a luma prediction block of the PU. Assuming thatthe size of a particular CU is 2N×2N, video encoder 20 and video decoder30 may support PU sizes of 2N×2N or N×N for intra prediction, andsymmetric PU sizes of 2N×2N, 2N×N, N×2N, N×N, or similar for interprediction. Video encoder 20 and video decoder 30 may also supportasymmetric partitioning for PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2Nfor inter prediction.

Inter-prediction processing unit 120 may generate predictive data for aPU by performing inter prediction on each PU of a CU. The predictivedata for the PU may include a predictive sample blocks of the PU andmotion information for the PU. Inter-prediction unit 121 may performdifferent operations for a PU of a CU depending on whether the PU is inan I slice, a P slice, or a B slice. In an I slice, all PUs are intrapredicted. Hence, if the PU is in an I slice, inter-prediction unit 121does not perform inter prediction on the PU. Thus, for blocks encoded inI-mode, the predicted block is formed using spatial prediction frompreviously-encoded neighboring blocks within the same frame.

If a PU is in a P slice, the motion estimation unit of inter-predictionprocessing unit 120 may search the reference pictures in a list ofreference pictures (e.g., “RefPicList0”) for a reference region for thePU. The reference region for the PU may be a region, within a referencepicture, that contains sample blocks that most closely corresponds tothe sample blocks of the PU. The motion estimation unit may generate areference index that indicates a position in RefPicList0 of thereference picture containing the reference region for the PU. Inaddition, the motion estimation unit may generate an MV that indicates aspatial displacement between a coding block of the PU and a referencelocation associated with the reference region. For instance, the MV maybe a two-dimensional vector that provides an offset from the coordinatesin the current decoded picture to coordinates in a reference picture.The motion estimation unit may output the reference index and the MV asthe motion information of the PU. The motion compensation unit ofinter-prediction processing unit 120 may generate the predictive sampleblocks of the PU based on actual or interpolated samples at thereference location indicated by the motion vector of the PU.

If a PU is in a B slice, the motion estimation unit may performuni-prediction or bi-prediction for the PU. To perform uni-predictionfor the PU, the motion estimation unit may search the reference picturesof RefPicList0 or a second reference picture list (“RefPicList1”) for areference region for the PU. The motion estimation unit may output, asthe motion information of the PU, a reference index that indicates aposition in RefPicList0 or RefPicList1 of the reference picture thatcontains the reference region, an MV that indicates a spatialdisplacement between a sample block of the PU and a reference locationassociated with the reference region, and one or more predictiondirection indicators that indicate whether the reference picture is inRefPicList0 or RefPicList1. The motion compensation unit ofinter-prediction processing unit 120 may generate the predictive sampleblocks of the PU based at least in part on actual or interpolatedsamples at the reference region indicated by the motion vector of thePU.

To perform bi-directional inter prediction for a PU, the motionestimation unit may search the reference pictures in RefPicList0 for areference region for the PU and may also search the reference picturesin RefPicList1 for another reference region for the PU. The motionestimation unit may generate reference picture indexes that indicatepositions in RefPicList0 and RefPicList1 of the reference pictures thatcontain the reference regions. In addition, the motion estimation unitmay generate MVs that indicate spatial displacements between thereference location associated with the reference regions and a sampleblock of the PU. The motion information of the PU may include thereference indexes and the MVs of the PU. The motion compensation unitmay generate the predictive sample blocks of the PU based at least inpart on actual or interpolated samples at the reference region indicatedby the motion vector of the PU.

In accordance with various examples of this disclosure, video encoder 20may be configured to perform palette-based coding. With respect to theHEVC framework, as an example, the palette-based coding techniques maybe configured to be used as a coding unit (CU) mode. In other examples,the palette-based coding techniques may be configured to be used as a PUmode in the framework of HEVC. Accordingly, all of the disclosedprocesses described herein (throughout this disclosure) in the contextof a CU mode may, additionally or alternatively, apply to PU. However,these HEVC-based examples should not be considered a restriction orlimitation of the palette-based coding techniques described herein, assuch techniques may be applied to work independently or as part of otherexisting or yet to be developed systems/standards. In these cases, theunit for palette coding can be square blocks, rectangular blocks or evenregions of non-rectangular shape.

Palette-based encoding unit 122, for example, may perform palette-baseddecoding when a palette-based encoding mode is selected, e.g., for a CUor PU. For example, palette-based encoding unit 122 may be configure togenerate a palette having entries indicating pixel values, select pixelvalues in a palette to represent pixels values of at least somepositions of a block of video data, and signal information associatingat least some of the positions of the block of video data with entriesin the palette corresponding, respectively, to the selected pixelvalues. Although various functions are described as being performed bypalette-based encoding unit 122, some or all of such functions may beperformed by other processing units, or a combination of differentprocessing units.

Palette-based encoding unit 122 may be configured to generate any of thevarious syntax elements described herein. Accordingly, video encoder 20may be configured to encode blocks of video data using palette-basedcode modes as described in this disclosure. Video encoder 20 mayselectively encode a block of video data using a palette coding mode, orencode a block of video data using a different mode, e.g., such an HEVCinter-predictive or intra-predictive coding mode. The block of videodata may be, for example, a CU or PU generated according to an HEVCcoding process. A video encoder 20 may encode some blocks withinter-predictive temporal prediction or intra-predictive spatial codingmodes and decode other blocks with the palette-based coding mode.

Intra-prediction processing unit 126 may generate predictive data for aPU by performing intra prediction on the PU. The predictive data for thePU may include predictive sample blocks for the PU and various syntaxelements. Intra-prediction processing unit 126 may perform intraprediction on PUs in I slices, P slices, and B slices.

To perform intra prediction on a PU, intra-prediction processing unit126 may use multiple intra prediction modes to generate multiple sets ofpredictive data for the PU. To use an intra prediction mode to generatea set of predictive data for the PU, intra-prediction processing unit126 may extend samples from sample blocks of neighboring PUs across thesample blocks of the PU in a direction associated with the intraprediction mode. The neighboring PUs may be above, above and to theright, above and to the left, or to the left of the PU, assuming aleft-to-right, top-to-bottom encoding order for PUs, CUs, and CTUs.Intra-prediction processing unit 126 may use various numbers of intraprediction modes, e.g., 33 directional intra prediction modes. In someexamples, the number of intra prediction modes may depend on the size ofthe region associated with the PU.

Prediction processing unit 100 may select the predictive data for PUs ofa CU from among the predictive data generated by inter-predictionprocessing unit 120 for the PUs or the predictive data generated byintra-prediction processing unit 126 for the PUs. In some examples,prediction processing unit 100 selects the predictive data for the PUsof the CU based on rate/distortion metrics of the sets of predictivedata. The predictive sample blocks of the selected predictive data maybe referred to herein as the selected predictive sample blocks.

Residual generation unit 102 may generate, based on the luma, Cb and Crcoding block of a CU and the selected predictive luma, Cb and Cr blocksof the PUs of the CU, a luma, Cb and Cr residual blocks of the CU. Forinstance, residual generation unit 102 may generate the residual blocksof the CU such that each sample in the residual blocks has a value equalto a difference between a sample in a coding block of the CU and acorresponding sample in a corresponding selected predictive sample blockof a PU of the CU.

Transform processing unit 104 may perform quad-tree partitioning topartition the residual blocks associated with a CU into transform blocksassociated with TUs of the CU. Thus, a TU may be associated with a lumatransform block and two chroma transform blocks. The sizes and positionsof the luma and chroma transform blocks of TUs of a CU may or may not bebased on the sizes and positions of prediction blocks of the PUs of theCU. A quad-tree structure known as a “residual quad-tree” (RQT) mayinclude nodes associated with each of the regions. The TUs of a CU maycorrespond to leaf nodes of the RQT.

Transform processing unit 104 may generate transform coefficient blocksfor each TU of a CU by applying one or more transforms to the transformblocks of the TU. Transform processing unit 104 may apply varioustransforms to a transform block associated with a TU. For example,transform processing unit 104 may apply a discrete cosine transform(DCT), a directional transform, or a conceptually similar transform to atransform block. In some examples, transform processing unit 104 doesnot apply transforms to a transform block. In such examples, thetransform block may be treated as a transform coefficient block.

Quantization unit 106 may quantize the transform coefficients in acoefficient block. The quantization process may reduce the bit depthassociated with some or all of the transform coefficients. For example,an n-bit transform coefficient may be rounded down to an m-bit transformcoefficient during quantization, where n is greater than m. Quantizationunit 106 may quantize a coefficient block associated with a TU of a CUbased on a quantization parameter (QP) value associated with the CU.Video encoder 20 may adjust the degree of quantization applied to thecoefficient blocks associated with a CU by adjusting the QP valueassociated with the CU. Quantization may introduce loss of information,thus quantized transform coefficients may have lower precision than theoriginal ones.

Inverse quantization unit 108 and inverse transform processing unit 110may apply inverse quantization and inverse transforms to a coefficientblock, respectively, to reconstruct a residual block from thecoefficient block. Reconstruction unit 112 may add the reconstructedresidual block to corresponding samples from one or more predictivesample blocks generated by prediction processing unit 100 to produce areconstructed transform block associated with a TU. By reconstructingtransform blocks for each TU of a CU in this way, video encoder 20 mayreconstruct the coding blocks of the CU.

Filter unit 114 may perform one or more deblocking operations to reduceblocking artifacts in the coding blocks associated with a CU. Decodedpicture buffer 116 may store the reconstructed coding blocks afterfilter unit 114 performs the one or more deblocking operations on thereconstructed coding blocks. Inter-prediction processing unit 120 mayuse a reference picture that contains the reconstructed coding blocks toperform inter prediction on PUs of other pictures. In addition,intra-prediction processing unit 126 may use reconstructed coding blocksin decoded picture buffer 116 to perform intra prediction on other PUsin the same picture as the CU.

Entropy encoding unit 118 may receive data from other functionalcomponents of video encoder 20. For example, entropy encoding unit 118may receive coefficient blocks from quantization unit 106 and mayreceive syntax elements from prediction processing unit 100. Entropyencoding unit 118 may perform one or more entropy encoding operations onthe data to generate entropy-encoded data. For example, entropy encodingunit 118 may perform a context-adaptive variable length coding (CAVLC)operation, a CABAC operation, a variable-to-variable (V2V) length codingoperation, a syntax-based context-adaptive binary arithmetic coding(SBAC) operation, a Probability Interval Partitioning Entropy (PIPE)coding operation, an Exponential-Golomb encoding operation, or anothertype of entropy encoding operation on the data. Video encoder 20 mayoutput a bitstream that includes entropy-encoded data generated byentropy encoding unit 118. For instance, the bitstream may include datathat represents a RQT for a CU.

In some examples, residual coding is not performed with palette coding.Accordingly, video encoder 20 may not perform transformation orquantization when coding using a palette coding mode. In addition, videoencoder 20 may entropy encode data generated using a palette coding modeseparately from residual data.

FIG. 3 is a block diagram illustrating an example video decoder 30 thatis configured to implement the techniques of this disclosure. FIG. 3 isprovided for purposes of explanation and is not limiting on thetechniques as broadly exemplified and described in this disclosure. Forpurposes of explanation, this disclosure describes video decoder 30 inthe context of HEVC coding. However, the techniques of this disclosuremay be applicable to other coding standards or methods.

Video decoder 30 represents an example of a device that may beconfigured to perform techniques for palette-based video coding inaccordance with various examples described in this disclosure. Forexample, video decoder 30 may be configured to selectively decodevarious blocks of video data, such as CU's or PU's in HEVC coding, usingeither palette-based coding or non-palette based coding. Non-palettebased coding modes may refer to various inter-predictive temporal codingmodes or intra-predictive spatial coding modes, such as the variouscoding modes specified by HEVC Draft 10. Video decoder 30, in oneexample, may be configured to generate a palette having entriesindicating pixel values, receive information associating at least somepositions of a block of video data with entries in the palette, selectpixel values in the palette based on the information, and reconstructpixel values of the block based on the selected pixel values.

In the example of FIG. 3, video decoder 30 includes an entropy decodingunit 150, a prediction processing unit 152, an inverse quantization unit154, an inverse transform processing unit 156, a reconstruction unit158, a filter unit 160, and a decoded picture buffer 162. Predictionprocessing unit 152 includes a motion compensation unit 164 and anintra-prediction processing unit 166. Video decoder 30 also includes apalette-based decoding unit 165 configured to perform various aspects ofthe palette-based coding techniques described in this disclosure. Inother examples, video decoder 30 may include more, fewer, or differentfunctional components.

A coded picture buffer (CPB) may receive and store encoded video data(e.g., NAL units) of a bitstream. Entropy decoding unit 150 may receiveencoded video data (e.g., NAL units) from the CPB and parse the NALunits to decode syntax elements. Entropy decoding unit 150 may entropydecode entropy-encoded syntax elements in the NAL units. Predictionprocessing unit 152, inverse quantization unit 154, inverse transformprocessing unit 156, reconstruction unit 158, and filter unit 160 maygenerate decoded video data based on the syntax elements extracted fromthe bitstream.

The NAL units of the bitstream may include coded slice NAL units. Aspart of decoding the bitstream, entropy decoding unit 150 may extractand entropy decode syntax elements from the coded slice NAL units. Eachof the coded slices may include a slice header and slice data. The sliceheader may contain syntax elements pertaining to a slice. The syntaxelements in the slice header may include a syntax element thatidentifies a PPS associated with a picture that contains the slice.

In addition to decoding syntax elements from the bitstream, videodecoder 30 may perform a reconstruction operation on a non-partitionedCU. To perform the reconstruction operation on a non-partitioned CU,video decoder 30 may perform a reconstruction operation on each TU ofthe CU. By performing the reconstruction operation for each TU of theCU, video decoder 30 may reconstruct residual blocks of the CU.

As part of performing a reconstruction operation on a TU of a CU,inverse quantization unit 154 may inverse quantize, i.e., de-quantize,coefficient blocks associated with the TU. Inverse quantization unit 154may use a QP value associated with the CU of the TU to determine adegree of quantization and, likewise, a degree of inverse quantizationfor inverse quantization unit 154 to apply. That is, the compressionratio, i.e., the ratio of the number of bits used to represent originalsequence and the compressed one, may be controlled by adjusting thevalue of the QP used when quantizing transform coefficients. Thecompression ratio may also depend on the method of entropy codingemployed.

After inverse quantization unit 154 inverse quantizes a coefficientblock, inverse transform processing unit 156 may apply one or moreinverse transforms to the coefficient block in order to generate aresidual block associated with the TU. For example, inverse transformprocessing unit 156 may apply an inverse DCT, an inverse integertransform, an inverse Karhunen-Loeve transform (KLT), an inverserotational transform, an inverse directional transform, or anotherinverse transform to the coefficient block.

If a PU is encoded using intra prediction, intra-prediction processingunit 166 may perform intra prediction to generate predictive blocks forthe PU. Intra-prediction processing unit 166 may use an intra predictionmode to generate the predictive luma, Cb and Cr blocks for the PU basedon the prediction blocks of spatially-neighboring PUs. Intra-predictionprocessing unit 166 may determine the intra prediction mode for the PUbased on one or more syntax elements decoded from the bitstream.

Prediction processing unit 152 may construct a first reference picturelist (RefPicList0) and a second reference picture list (RefPicList1)based on syntax elements extracted from the bitstream. Furthermore, if aPU is encoded using inter prediction, entropy decoding unit 150 mayextract motion information for the PU. Motion compensation unit 164 maydetermine, based on the motion information of the PU, one or morereference regions for the PU. Motion compensation unit 164 may generate,based on samples blocks at the one or more reference blocks for the PU,predictive luma, Cb and Cr blocks for the PU.

Reconstruction unit 158 may use the luma, Cb and Cr transform blocksassociated with TUs of a CU and the predictive luma, Cb and Cr blocks ofthe PUs of the CU, i.e., either intra-prediction data orinter-prediction data, as applicable, to reconstruct the luma, Cb and Crcoding blocks of the CU. For example, reconstruction unit 158 may addsamples of the luma, Cb and Cr transform blocks to corresponding samplesof the predictive luma, Cb and Cr blocks to reconstruct the luma, Cb andCr coding blocks of the CU.

Filter unit 160 may perform a deblocking operation to reduce blockingartifacts associated with the luma, Cb and Cr coding blocks of the CU.Video decoder 30 may store the luma, Cb and Cr coding blocks of the CUin decoded picture buffer 162. Decoded picture buffer 162 may providereference pictures for subsequent motion compensation, intra prediction,and presentation on a display device, such as display device 32 ofFIG. 1. For instance, video decoder 30 may perform, based on the luma,Cb and Cr blocks in decoded picture buffer 162, intra prediction orinter prediction operations on PUs of other CUs. In this way, videodecoder 30 may extract, from the bitstream, transform coefficient levelsof the significant luma coefficient block, inverse quantize thetransform coefficient levels, apply a transform to the transformcoefficient levels to generate a transform block, generate, based atleast in part on the transform block, a coding block, and output thecoding block for display.

In accordance with various examples of this disclosure, video decoder 30may be configured to perform palette-based coding. Palette-baseddecoding unit 165, for example, may perform palette-based decoding whena palette-based decoding mode is selected, e.g., for a CU or PU. Forexample, palette-based decoding unit 165 may be configure to generate apalette having entries indicating pixel values, receive informationassociating at least some positions of a block of video data withentries in the palette, select pixel values in the palette based on theinformation, and reconstruct pixel values of the block based on theselected pixel values. Although various functions are described as beingperformed by palette-based decoding unit 165, some or all of suchfunctions may be performed by other processing units, or a combinationof different processing units.

Palette-based decoding unit 165 may receive palette coding modeinformation, and perform the above operations when the palette codingmode information indicates that the palette coding mode applies to theblock. When the palette coding mode information indicates that thepalette coding mode does not apply to the block, or when other modeinformation indicates the use of a different mode, palette-baseddecoding unit 165 decodes the block of video data using a non-palettebased coding mode, e.g., such an HEVC inter-predictive orintra-predictive coding mode, when the palette coding mode informationindicates that the palette coding mode does not apply to the block. Theblock of video data may be, for example, a CU or PU generated accordingto an HEVC coding process. A video decoder 30 may decode some blockswith inter-predictive temporal prediction or intra-predictive spatialcoding modes and decode other blocks with the palette-based coding mode.The palette-based coding mode may comprise one of a plurality ofdifferent palette-based coding modes, or there may be a singlepalette-based coding mode.

The palette coding mode information received by palette-based decodingunit 165 may comprise a palette mode syntax element, such as a flag. Afirst value of the palette mode syntax element indicates that thepalette coding mode applies to the block and a second value of thepalette mode syntax element indicates that the palette coding mode doesnot apply to the block of video data. Palette-based decoding unit 165may receive (e.g., from video encoder 20) the palette coding modeinformation at one or more of a predictive unit level, a coding unitlevel, a slice level, or a picture level, or may receive an indicationof whether palette coding mode is enabled in at least one of pictureparameter set (PPS), sequence parameter set (SPS) or video parameter set(VPS).

In some examples, palette-based decoding unit 165 may infer the palettecoding mode information based on one or more of a size of the codingblock, a frame type, a color space, a color component, a frame size, aframe rate, a layer id in scalable video coding or a view id inmulti-view coding associated with the block of video data.

Palette-based decoding unit 165 also may be configured to receiveinformation defining at least some of the entries in the palette withvideo data, and generate the palette based at least in part on thereceived information. The size of the palette may be fixed or variable.In some cases, the size of the palette is variable and is adjustablebased on information signaled with the video data. The signaledinformation may specify whether an entry in the palette is a last entryin the palette. Also, in some cases, the palette may have a maximumsize. The size of the palette may also be conditionally transmitted orinferred. The conditions may be the size of the CU, the frame type, thecolor space, the color component, the frame size, the frame rate, thelayer id in scalable video coding or the view id in multi-view coding.

The palette may be a single palette including entries indicating pixelvalues for a luma component and chroma components of the block. In thiscase, each entry in the palette is a triple entry indicating pixelvalues for the luma component and two chroma components. Alternatively,the palette includes a luma palette including entries indicating pixelvalues of a luma component of the block, and chroma palettes includingentries indicating pixel values for respective chroma components of theblock.

In some examples, palette-based decoding unit 165 may generate thepalette by predicting the entries in the palette based on previouslyprocessed data. The previously processed data may include palettes, orinformation from palettes, for previously decoded neighboring blocks.Palette-based decoding unit 165 may receive a prediction syntax elementindicating whether the entries in the palette are to be predicted. Theprediction syntax element may include a plurality of prediction syntaxelements indicating, respectively, whether entries in palettes for lumaand chroma components are to be predicted.

With respect to a predictive palette, for example, a predictive palettemay contain palette entries from one or more neighboring blocksincluding spatially neighboring blocks and/or neighboring blocks in aparticular scan order of the blocks. In an example, the neighboringblocks may be spatially located to the left (left neighboring block) ofor above (upper neighboring block) the block currently being coded. Inanother example, palette-based decoding unit 165 may determinepredictive palette entries using the most frequent sample values in acausal neighbor of the current block. In another example, theneighboring blocks may neighbor the block current being coded accordingto a particular scan order used to code the blocks. That is, theneighboring blocks may be one or more blocks coded prior to the currentblock in the scan order. Palette-based decoding unit 165 may decode oneor more syntax elements to indicate the location of the neighboringblocks from which the palette(s) are copied.

Thus, in an example, palette-based decoding unit 165 may, in someexamples, predict at least some of the entries in the palette based onentries in a palette for a left neighbor block or a top neighbor blockin a slice or picture. In this case, the entries in the palette that arepredicted based on entries in either a palette for the left neighborblock or the top neighbor block may be predicted by palette-baseddecoding unit 165 based on a syntax element that indicates selection ofthe left neighbor block or the top neighbor block for prediction. Thesyntax element may be a flag having a value that indicates selection ofthe left neighbor block or the top neighbor block for prediction.

In some examples, palette-based decoding unit 165 may receive one ormore prediction syntax elements that indicate whether at least someselected entries in the palette, on an entry-by-entry basis, are to bepredicted, and generate the entries accordingly. For example,palette-based decoding unit 165 may decode one or more syntax elementsto indicate, for each entry of a predictive palette, whether the paletteentry is included in the palette for the current block. If an entry isnot predicted, palette-based decoding unit 165 may decode one or moreadditional syntax elements to specify the non-predicted entries, as wellas the number of such entries. Thus, palette-based decoding unit 165 maypredict some of the entries and receive information directly specifyingother entries in the palette including the number of additional entries.

In some examples, techniques for predicting an entire palette may becombined with techniques for predicting one or more entries of apalette. For example, palette-based decoding unit 165 may decode one ormore syntax elements in a bitstream to indicate whether the currentpalette is entirely copied from the predictive palette. If this is notthe case, palette-based decoding unit 165 may decode one or more syntaxelements in a bitstream to indicate whether each entry in the predictivepalette is copied.

In another example, instead of receiving the number of entries and thepalette value, palette-based decoding unit 165 may receive, after eachpalette value, a flag to indicate whether the signaled palette value isthe final palette entry for the palette. Palette-based decoding unit 165may not receive such an “end of palette” flag if the palette has alreadyreached a certain maximum size.

Information, received by palette-based decoding unit 165, associating atleast some positions of a block of video data with entries in thepalette may comprise map information including palette index values forat least some of the positions in the block, wherein each of the paletteindex values corresponds to one of the entries in the palette. The mapinformation may include one or more run syntax elements that eachindicates a number of consecutive positions in the block having the samepalette index value.

In some examples, palette-based decoding unit 165 may receiveinformation indicating line copying whereby pixel or index values for aline of positions in the block are copied from pixel or index values foranother line of positions in the block. Palette-based decoding unit 165may use this information to perform line copying to determine pixelvalues or entries in the palette for various positions of a block. Theline of positions may comprise a row, a portion of a row, a column or aportion of a column of positions of the block.

Palette-based decoding unit 165 may generate the palette in part byreceiving pixel values for one or more positions of the block, andadding the pixel values to entries in the palette to dynamicallygenerate at least a portion the palette on-the-fly. Adding the pixelvalues may comprise adding the pixel values to an initial palettecomprising an initial set of entries, or to an empty palette that doesnot include an initial set of entries. In some examples, addingcomprises adding the pixel values to add new entries to an initialpalette comprising an initial set of entries or fill existing entries inthe initial palette, or replacing or changing pixel values of entries inthe initial palette.

In some examples, palette-based decoding unit 165 may determine a fixed,maximum size for a palette. Upon reaching the maximum size palette-baseddecoding unit 165 may remove one or more entries of the palette. In oneexample, palette-based decoding unit 165 may remove the oldest entry ofthe palette, e.g., using a FIFO queue. In another example, palette-baseddecoding unit 165 may remove the least used entry. In still anotherexample, palette-based decoding unit 165 may make a weighteddetermination regarding which entry to remove based on when a candidateentry to be removed was added to the palette and the relative usage ofthat entry.

In some examples, the palette may be a quantized palette in which apixel value selected from the palette for one of the positions in theblock is different from an actual pixel value of the position in theblock, such that the decoding process is lossy. For example, the samepixel value may be selected from the palette for two different positionshaving different actual pixel values.

FIG. 4 is a conceptual diagram illustrating an example of determining apalette for coding video data, consistent with techniques of thisdisclosure. The example of FIG. 4 includes a picture 178 having a firstcoding unit (CU) 180 that is associated with first palettes 184 and asecond CU 188 that is associated with second palettes 192. As describedin greater detail below and in accordance with the techniques of thisdisclosure, second palettes 192 are based on first palettes 184. Picture178 also includes block 196 coded with an intra-prediction coding modeand block 200 that is coded with an inter-prediction coding mode.

The techniques of FIG. 4 are described in the context of video encoder20 (FIG. 1 and FIG. 2) and video decoder 30 (FIG. 1 and FIG. 3) and withrespect to the HEVC video coding standard for purposes of explanation.However, it should be understood that the techniques of this disclosureare not limited in this way, and may be applied by other video codingprocessors and/or devices in other video coding processes and/orstandards.

In general, a palette refers to a number of pixel values that aredominant and/or representative for a CU currently being coded, CU 188 inthe example of FIG. 4. First palettes 184 and second palettes 192 areshown as including multiple palettes. In some examples, according toaspects of this disclosure, a video coder (such as video encoder 20 orvideo decoder 30) may code palettes separately for each color componentof a CU. For example, video encoder 20 may encode a palette for a luma(Y) component of a CU, another palette for a chroma (U) component of theCU, and yet another palette for the chroma (V) component of the CU. Inthis example, entries of the Y palette may represent Y values of pixelsof the CU, entries of the U palette may represent U values of pixels ofthe CU, and entries of the V palette may represent V values of pixels ofthe CU.

In other examples, video encoder 20 may encode a single palette for allcolor components of a CU. In this example, video encoder 20 may encode apalette having an i-th entry that is a triple value, including Yi, Ui,and Vi. In this case, the palette includes values for each of thecomponents of the pixels. Accordingly, the representation of palettes184 and 192 as a set of palettes having multiple individual palettes ismerely one example and not intended to be limiting.

In the example of FIG. 4, first palettes 184 includes three entries202-206 having entry index value 1, entry index value 2, and entry indexvalue 3, respectively. Entries 202-206 relate the index values to pixelvalues including pixel value A, pixel value B, and pixel value C,respectively. As described herein, rather than coding the actual pixelvalues of first CU 180, a video coder (such as video encoder 20 or videodecoder 30) may use palette-based coding to code the pixels of the blockusing the indices 1-3. That is, for each pixel position of first CU 180,video encoder 20 may encode an index value for the pixel, where theindex value is associated with a pixel value in one or more of firstpalettes 184. Video decoder 30 may obtain the index values from abitstream and reconstruct the pixel values using the index values andone or more of first palettes 184. Thus, first palettes 184 aretransmitted by video encoder 20 in an encoded video data bitstream foruse by video decoder 30 in palette-based decoding. In general, one ormore palettes may be transmitted for each CU or may be shared amongdifferent CUs.

According to aspects of this disclosure, video encoder 20 and videodecoder 30 may determine second palettes 192 based on first palettes184. For example, video encoder 20 may encode a pred_palette_flag foreach CU (including, as an example, second CU 188) to indicate whetherthe palette for the CU is predicted from one or more palettes associatedwith one or more other CUs, such as neighboring CUs (spatially or basedon scan order) or the most frequent samples of a causal neighbor. Forexample, when the value of such a flag is equal to one, video decoder 30may determine that second palettes 192 for second CU 188 are predictedfrom one or more already decoded palettes and therefore no new palettesfor second CU 188 are included in a bitstream containing thepred_palette_flag. When such a flag is equal to zero, video decoder 30may determine that palette 192 for second CU 188 is included in thebitstream as a new palette. In some examples, pred_palette_flag may beseparately coded for each different color component of a CU (e.g., threeflags, one for Y, one for U, and one for V, for a CU in YUV video). Inother examples, a single pred_palette_flag may be coded for all colorcomponents of a CU.

In the example above, the pred_palette_flag is signaled per-CU toindicate whether any of the entries of the palette for the current blockare predicted. In some examples, one or more syntax elements may besignaled on a per-entry basis. That is a flag may be signaled for eachentry of a palette predictor to indicate whether that entry is presentin the current palette. As noted above, if a palette entry is notpredicted, the palette entry may be explicitly signaled.

When determining second palettes 192 relative to first palettes 184(e.g., pred_palette_flag is equal to one), video encoder 20 and/or videodecoder 30 may locate one or more blocks from which the predictivepalettes, in this example first palettes 184, are determined. Thepredictive palettes may be associated with one or more neighboring CUsof the CU currently being coded (e.g., such as neighboring CUs(spatially or based on scan order) or the most frequent samples of acausal neighbor), i.e., second CU 188. The palettes of the one or moreneighboring CUs may be associated with a predictor palette. In someexamples, such as the example illustrated in FIG. 4, video encoder 20and/or video decoder 30 may locate a left neighboring CU, first CU 180,when determining a predictive palette for second CU 188. In otherexamples, video encoder 20 and/or video decoder 30 may locate one ormore CUs in other positions relative to second CU 188, such as an upperCU, CU 196.

Video encoder 20 and/or video decoder 30 may determine a CU for paletteprediction based on a hierarchy. For example, video encoder 20 and/orvideo decoder 30 may initially identify the left neighboring CU, firstCU 180, for palette prediction. If the left neighboring CU is notavailable for prediction (e.g., the left neighboring CU is coded with amode other than a palette-based coding mode, such as an intra-predictionmore or intra-prediction mode, or is located at the left-most edge of apicture or slice) video encoder 20 and/or video decoder 30 may identifythe upper neighboring CU, CU 196. Video encoder 20 and/or video decoder30 may continue searching for an available CU according to apredetermined order of locations until locating a CU having a paletteavailable for palette prediction. In some examples, video encoder 20and/or video decoder 30 may determine a predictive palette based onmultiple blocks and/or reconstructed samples of a neighboring block.

While the example of FIG. 4 illustrates first palettes 184 as predictivepalettes from a single CU, first CU 180, in other examples, videoencoder 20 and/or video decoder 30 may locate palettes for predictionfrom a combination of neighboring CUs. For example, video encoder 20and/or video decoder may apply one or more formulas, functions, rules orthe like to generate a palette based on palettes of one or a combinationof a plurality of neighboring CUs.

In still other examples, video encoder 20 and/or video decoder 30 mayconstruct a candidate list including a number of potential candidatesfor palette prediction. In such examples, video encoder 20 may encode anindex to the candidate list to indicate the candidate CU in the listfrom which the current CU used for palette prediction is selected (e.g.,copies the palette). Video decoder 30 may construct the candidate listin the same manner, decode the index, and use the decoded index toselect the palette of the corresponding CU for use with the current CU.

In an example for purposes of illustration, video encoder 20 and videodecoder 30 may construct a candidate list that includes one CU that ispositioned above the CU currently being coded and one CU that ispositioned to the left of the CU currently being coded. In this example,video encoder 20 may encode one or more syntax elements to indicate thecandidate selection. For example, video encoder 20 may encode a flaghaving a value of zero to indicate that the palette for the current CUis copied from the CU positioned to the left of the current CU. Videoencoder 20 may encode the flag having a value of one to indicate thatthe palette for the current CU is copied from the CU positioned abovethe current CU. Video decoder 30 decodes the flag and selects theappropriate CU for palette prediction.

In still other examples, video encoder 20 and/or video decoder 30determine the palette for the CU currently being coded based on thefrequency with which sample values included in one or more otherpalettes occur in one or more neighboring CUs. For example, videoencoder 20 and/or video decoder 30 may track the colors associated withthe most frequently used index values during coding of a predeterminednumber of CUs. Video encoder 20 and/or video decoder 30 may include themost frequently used colors in the palette for the CU currently beingcoded.

As noted above, in some examples, video encoder 20 and/or video decodermay copy an entire palette from a neighboring CU for coding a currentCU. Additionally or alternatively, video encoder 20 and/or video decoder30 may perform entry-wise based palette prediction. For example, videoencoder 20 may encode one or more syntax elements for each entry of apalette indicating whether the respective entries are predicted based ona predictive palette (e.g., a palette of another CU). In this example,video encoder 20 may encode a flag having a value equal to one for agiven entry when the entry is a predicted value from a predictivepalette (e.g., a corresponding entry of a palette associated with aneighboring CU). Video encoder 20 may encode a flag having a value equalto zero for a particular entry to indicate that the particular entry isnot predicted from a palette of another CU. In this example, videoencoder 20 may also encode additional data indicating the value of thenon-predicted palette entry.

In the example of FIG. 4, second palettes 192 includes four entries208-214 having entry index value 1, entry index value 2, entry indexvalue 3, and entry index 4, respectively. Entries 208-214 relate theindex values to pixel values including pixel value A, pixel value B,pixel value C, and pixel value D, respectively. According to aspects ofthis disclosure, video encoder 20 and/or video decoder 30 may use any ofthe above-described techniques to locate first CU 180 for purposes ofpalette prediction and copy entries 1-3 of first palettes 184 to entries1-3 of second palettes 192 for coding second CU 188. In this way, videoencoder 20 and/or video decoder 30 may determine second palettes 192based on first palettes 184. In addition, video encoder 20 and/or videodecoder 30 may code data for entry 4 to be included with second palettes192. Such information may include the number of palette entries notpredicted from a predictor palette and the pixel values corresponding tothose palette entries.

In some examples, according to aspects of this disclosure, one or moresyntax elements may indicate whether palettes, such as second palettes192, are predicted entirely from a predictive palette (shown in FIG. 4as first palettes 184, but which may be composed of entries from one ormore blocks) or whether particular entries of second palettes 192 arepredicted. For example, an initial syntax element may indicate whetherall of the entries are predicted. If the initial syntax elementindicates that not all of the entries are predicted (e.g., a flag havinga value of 0), one or more additional syntax elements may indicate whichentries of second palettes 192 are predicted from the predictivepalette.

According to some aspects of this disclosure, certain informationassociated with palette prediction may be inferred from one or morecharacteristics of the data being coded. That is, rather than videoencoder 20 encoding syntax elements (and video decoder 30 decoding suchsyntax elements) video encoder 20 and video decoder 30 may performpalette prediction based on one or more characteristics of the databeing coded.

In an example, for purposes of illustration, the value ofpred_palette_flag, described above, may be inferred from one or more of,as examples, the size of the CU being coded, the frame type, the colorspace, the color component, the frame size, the frame rate, the layer idin scalable video coding or the view id in multi-view coding. That is,with respect to the size of the CU as an example, video encoder 20and/or video decoder 30 may determine that the above-describedpred_palette_flag is equal to one for any CUs that exceed apredetermined size. In this example, the pred_palette_flag does not needto be signaled in the encoded bistream.

While described above with respect to the pred_palette_flag, videoencoder 20 and/or video decoder 30 may also or alternatively infer otherinformation associated with palette prediction, such as the candidate CUfrom which the palette is used for prediction, or rules for constructingpalette prediction candidates, based on one or more characteristics ofthe data being coded.

According to other aspects of this disclosure, video encoder 20 and/orvideo decoder 30 may construct a palette on-the-fly. For example, wheninitially coding second CU 188, there are no entries in palettes 192. Asvideo encoder 20 and video decoder 30 code new values for pixels ofsecond CU 188, each new value is included in palettes 192. That is, forexample, video encoder 20 adds pixel values to palettes 192 as the pixelvalues are generated and signaled for positions in CU 188. As videoencoder 20 encodes pixels relatively later in the CU, video encoder 20may encode pixels having the same values as those already included inthe palette using index values rather than signaling the pixel values.Similarly, when video decoder 30 receives a new pixel value (e.g.,signaled by video encoder 20) for a position in second CU 188, videodecoder 30 includes the pixel value in palettes 192. When pixelpositions decoded relatively later in second CU 188 have pixel valuesthat have been added to second palettes 192, video decoder 30 mayreceive information such as, e.g., index values, that identify thecorresponding pixel values in second palettes 192 for reconstruction ofthe pixel values of second CU 188.

In some examples, as described in greater detail below, video encoder 20and/or video decoder 30 may maintain palettes 184 and 192 at or below amaximum palette size. According to aspects of this disclosure, if amaximum palette size is reached, e.g., as second palettes 192 areconstructed dynamically on-the-fly, then video encoder 20 and/or videodecoder 30 perform the same process to remove an entry of secondpalettes 192. One example process for removing palette entries is afirst-in-first-out (FIFO) technique in which video encoder 20 and videodecoder 30 remove the oldest entry of a palette. In another example,video encoder 20 and video decoder 30 may remove the least frequentlyused palette entry from the palette. In still another example, videoencoder 20 and video decoder 30 may weight both FIFO and frequency ofuse processes to determine which entry to remove. That is, removal of anentry may be based on how the old the entry is and how frequently it isused.

According to some aspects, if an entry (pixel value) is removed from apalette and the pixel value occurs again at a later position in the CUbeing coded, video encoder 20 may encode the pixel value instead ofincluding an entry in the palette and encoding an index. Additionally oralternatively, video encoder 20 may re-enter palette entries into thepalette after having been removed, e.g., as video encoder 20 and videodecoder 30 scan the positions in the CU.

In some examples, the techniques for deriving a palette on-the-fly maybe combined with one or more other techniques for determining a palette.In particular, as an example, video encoder 20 and video decoder 30 mayinitially code second palettes 192 (e.g., using palette prediction topredict second palettes 192 from first palettes 184) and may updatesecond palettes 192 when coding pixels of second CU 188. For example,upon transmitting the initial palette, video encoder 20 may add valuesto the initial palette or change values in the initial palette as pixelvalues of additional locations in the CU are scanned. Likewise, uponreceiving an initial palette, video decoder 30 may add values to theinitial palette or change values in the initial palette as pixel valuesof additional locations in the CU are scanned.

Video encoder 20 may, in some examples, signal whether the current CUuses transmission of an entire palette, or on-the-fly palettegeneration, or a combination of transmission of an initial palette withupdating of the initial palette by on-the-fly derivation. In someexamples, the initial palette may be a full palette at maximum palettesize, in which case values in the initial palette may be changed. Inother examples, the initial palette may be smaller than the maximumpalette size, in which cases video encoder 20 and video decoder 30 mayadd values to and/or change values of the initial palette.

According to aspects of this disclosure, the size of palettes, such asfirst palettes 184 and second palettes 192, e.g., in terms of the numberof pixel values that are included in the palette may be fixed or may besignaled using one or more syntax elements in an encoded bitstream. Forexample, according to some aspects, video encoder 20 and video decoder30 may use unary codes or truncated unary codes (e.g., codes thattruncate at a maximum limit of the palette size) to code the palettesize. According to other aspects, video encoder 20 and video decoder 30may use Exponential-Golomb or Rice-Golomb codes to code the palettesize.

According to still other aspects, video encoder 20 and video decoder 30may code data indicating the size of the palette after each entry of thepalette. With respect to second palettes 192 as an example, videoencoder 20 may encode a stop flag after each of entries 208-214. In thisexample, a stop flag equal to one may specify that the entry currentlybeing coded is the final entry of second palettes 192, while a stop flagequal to zero may indicate that there are additional entries in secondpalettes 192. Accordingly, video encoder 20 may encode stop flags havinga value of zero after each of entries 208-212 and a stop flag having avalue of one after entry 214. In some instances, the stop flag may notbe included in the bitstream upon the constructed palette reaching amaximum palette size limit. While the examples above disclose techniquesfor explicitly signaling the size of palettes, in other examples, thesize of palettes may also be conditionally transmitted or inferred basedon so-called side information (e.g., characteristic information such asthe size of the CU being coded, the frame type, the color space, thecolor component, the frame size, the frame rate, the layer id inscalable video coding or the view id in multi-view coding, as notedabove).

The techniques of this disclosure include coding data losslessly, or,alternatively, with some losses (lossy coding). For example, withrespect to lossy coding, video encoder 20 may code the pixels of a CUwithout exactly matching the pixel values of palettes exactly to theactual pixel values in the CU. When the techniques of this disclosureare applied to lossy coding, some restrictions may be applied to thepalette. For example, video encoder 20 and video decoder 30 may quantizepalettes, such as first palettes 184 and second palettes 192. That is,video encoder 20 and video decoder 30 may merge (quantize) entries of apalette when the pixel values of the entries are within a predeterminedrange of each other. In other words, if there is already a palette valuethat is within an error margin of a new palette value, the new palettevalue is not added to the palette. In another example, a plurality ofdifferent pixel values in a block may be mapped to a single paletteentry, or, equivalently, to a single palette pixel value.

Video decoder 30 may decode pixel values in the same manner, regardlessof whether a particular palette is lossless or lossy. As one example,video decoder 30 may use an index value transmitted by video encoder 20for a given pixel position in a coded block to select an entry in thepalette for the pixel position, without regard to whether the palette islossless or lossy. In this example, the pixel value of the palette entryis used as the pixel value in the coded block, whether it matches theoriginal pixel value exactly or not.

In an example of lossy coding, for purposes of illustration, videoencoder 20 may determine an error bound, referred to as a delta value. Acandidate pixel value entry Plt_cand may correspond to a pixel value ata position in a block to be coded, such as CU or PU. During constructionof the palette, video encoder 20 determines the absolute differencebetween the candidate pixel value entry Plt_cand and all of the existingpixel value entries in the palette. If all of the absolute differencesbetween the candidate pixel value entry Plt_cand and the existing pixelvalue entries in the palette are larger than the delta value, videoencoder 20 may add the pixel value candidate to the palette as an entry.If an absolute difference between the pixel value entry Plt_cand and atleast one existing pixel value entry in the palette is equal to orsmaller than the delta value, video encoder 20 may not add the candidatepixel value entry Plt_cand to the palette. Thus, when coding the pixelvalue entry Plt_cand, video encoder 20 may select the entry with thepixel value that is the closest to the pixel value entry Plt_cand,thereby introducing some loss into the system. When a palette consistsof multiple components (e.g. three color components), the sum ofabsolute difference of individual component values may be used forcomparison against the delta value. Alternatively or additionally, theabsolute difference for each component value may be compared against asecond delta value.

In some examples, the existing pixel value entries in the palette notedabove may have been added using a similar delta comparison process. Inother examples, the existing pixel values in the palette may have beenadded using other processes. For example, one or more initial pixelvalue entries may be added to a palette (without a delta comparison) tostart the delta comparison process of constructing the palette. Theprocess described above may be implemented by video encoder 20 and/orvideo decoder 30 to produce luma and/or chroma palettes.

The techniques described above with respect to palette construction mayalso be used by video encoder 20 and video decoder 30 during pixelcoding. For example, when encoding of a pixel value, video encoder 20may compare the value of the pixel with the pixel values of entries inthe palette. If the absolute pixel value difference between the value ofthe pixel and one of the entries in the palette is equal to or smallerthan a delta value, video encoder 20 may encode the pixel value as theentry of the palette. That is, in this example, video encoder 20 encodesthe pixel value using one of the entries of the palette when the pixelvalue produces a sufficiently small (e.g., within a predetermined range)absolute difference versus the palette entry.

In some examples, video encoder 20 may select the palette entry thatyields the smallest absolute pixel value difference (compared to thepixel value being coded) to encode the pixel value. As an example, videoencoder 20 may encode an index to indicate a palette entry that will beused for the pixel value, e.g., the palette pixel value entry that willbe used to reconstruct the coded pixel value at video decoder 30. If theabsolute pixel value difference between the value of the pixel and allof the entries in the palette is greater than delta, the encoder may notuse one of the palette entries to encode the pixel value, and insteadmay transmit the pixel value of the pixel to be coded to video decoder30 (and possibly add the pixel value as an entry to the palette).

In another example, video encoder 20 may select an entry of a palettefor encoding a pixel value. Video encoder 20 may use the selected entryas a predictive pixel value. That is, video encoder 20 may determine aresidual value representing a difference between the actual pixel valueand the selected entry and encode the residue. Video encoder 20 maygenerate residual values for pixels in a block that are predicted byentries of a palette, and may generate a residue block includingrespective residual pixel values for the block of pixels. Video encoder20 may subsequently apply transformation and quantization (as notedabove with respect to FIG. 2) to the residue block. In this manner,video encoder 20 may generate quantized residual transform coefficients.

Video decoder 30 may inverse transform and inverse quantize thetransform coefficients to reproduce the residual block. Video decoder 30may then reconstruct a pixel value using the predictive palette entryvalue and the residual value for the pixel value. For example, videodecoder 30 may combine the residual value with the palette entry valueto reconstruct the coded pixel value.

In some examples, the delta value may be different for different CUsizes, picture sizes, color spaces or different color components. Thedelta value may be predetermined or determined based on various codingconditions. For example, video encoder 20 may signal the delta value tovideo decoder 30 using high level syntax, such as syntax in PPS, SPS,VPS and/or slice header. In other examples, video encoder 20 and videodecoder 30 may be preconfigured to use the same, fixed delta value. Instill other examples, video encoder 20 and/or video decoder 30 mayadaptively derive the delta value based on side information (e.g., suchas CU size, color space, color component, or the like, as noted above).

In some examples, a lossy coding palette mode may be included as an HEVCcoding mode. For example, coding modes may include an intra-predictionmode, an inter-prediction mode, a lossless coding palette mode, and alossy coding palette mode. In HEVC coding, as noted above with respectto FIGS. 2 and 3, a quantization parameter (QP) is used to control theallowed distortion. The value of delta for palette-based coding may becalculated or otherwise determined as a function of QP. For example, theabove-described delta value may be 1<<(QP/6) or 1<<((QP+d)/6) where d isa constant, and “<<” represents the bitwise left-shift operator.

Generation of a palette using the lossy coding techniques described inthis disclosure may be performed by video encoder 20, video decoder 30or both. For example, video encoder 20 may generate entries in a palettefor a CU using the delta comparison techniques described above andsignal information for construction of the palette for use by videodecoder 30. That is, video encoder 20 may be configured to signalinformation indicating pixel values for entries in a palette for a CU,and then encode pixel values using the pixel values associated with suchpalette entries. Video decoder 30 may construct a palette using suchinformation, and then use the entries to decode pixel values of a codedblock. In some examples, video encoder 20 may signal index values thatidentify palette entries for one or more pixel positions of the codedblock, and video decoder 30 may use the index values to retrieve thepertinent pixel value entries from the palette.

In other examples, video decoder 30 may be configured to construct apalette by applying the delta comparison techniques described above. Forexample, video decoder 30 may receive pixel values for positions withina coded block and determine whether absolute differences between thepixel values and the existing pixel value entries in the palette arelarger than a delta value. If so, video decoder 30 may add the pixelvalues as entries in the palette, e.g., for later use in palette-baseddecoding of pixel values for other pixel positions of the block usingcorresponding index values signaled by video encoder 20. In this case,video encoder 20 and video decoder 30 apply the same or similarprocesses to generate the palette. If not, video decoder 30 may not addthe pixel values to the palette.

In an example for purposes of illustration, video decoder 30 may receiveindex values or pixel values for various pixel positions in a block. Ifan index value is received for a pixel position, for example, videodecoder 30 may use the index value to identify an entry in the palette,and use the pixel value of the palette entry for the pixel position. Ifa pixel value is received for the pixel position, video decoder 30 mayuse the received pixel value for the pixel position, and also apply thedelta comparison to determine whether the pixel value should be added tothe palette and then later used for palette coding.

On the encoder side, if a pixel value for a position in a block producesan absolute difference between the pixel value and an existing pixelvalue entry in the palette that is less than or equal to the deltavalue, video encoder 20 may send an index value to identify the entry inthe palette for use in reconstructing the pixel value for that position.If a pixel value for a position in a block produces absolute differencevalues between the pixel value and the existing pixel value entries inthe palette that are all greater than the delta value, video encoder 20may send the pixel value and add the pixel value as a new entry in thepalette. To construct the palette, video decoder 30 may use delta valuessignaled by the encoder, rely on a fixed or known delta value, or inferor derive a delta value, e.g., as described above.

As noted above, video encoder 20 and/or video decoder 30 may use codingmodes including an intra-prediction mode, an inter-prediction mode, alossless coding palette mode, and a lossy coding palette mode whencoding video data. According to some aspects of this disclosure, videoencoder 20 and video decoder 30 may code one or more syntax elementsindicating whether palette-based coding is enabled. For example, at eachCU, video encoder 20 may encode a syntax element, such as a flagPLT_Mode_flag. The PLT_Mode_flag or other syntax element may indicatewhether a palette-based coding mode is to be used for a given CU (or aPU in other examples). For example, this flag may be signaled in anencoded video bitstream at the CU level, and then received by videodecoder 30 upon decoding the encoded video bitstream.

In this example, a value of this PLT_Mode_flag equal to 1 may specifythat the current CU is encoded using a palette-based coding mode. Inthis case, video decoder 30 may apply the palette-based coding mode todecode the CU. In some examples, a syntax element may indicate one of aplurality of different palette-based coding modes for the CU (e.g.,lossy or lossless). A value of this PLT_Mode_flag equal to 0 may specifythat the current CU is encoded using a mode other than palette mode. Forexample, any of a variety of inter-predictive, intra-predictive, orother coding modes may be used. When a value of PLT_Mode_flag is 0,video encoder 20 may also encode additional data to indicate thespecific mode used for encoding the respective CU (e.g., an HEVC codingmode). The use of the PLT_Mode_flag is described for purposes ofexample. In other examples, however, other syntax elements such asmulti-bit codes may be used to indicate whether the palette-based codingmode is to be used for a CU (or PU in other examples) or to indicatewhich of a plurality of modes are to be used for coding.

In some examples, the above-described flag or other syntax elements maybe transmitted at a higher level than the CU (or PU) level. For example,video encoder 20 may signal such a flag at a slice level. In this case,a value equal to 1 indicates that all of the CUs in the slice areencoded using palette mode. In this example, no additional modeinformation, e.g., for palette mode or other modes, is signaled at theCU level. In another example, video encoder 20 may signal such a flag ina PPS, SPS or VPS.

According to some aspects of this disclosure, video encoder 20 and/orvideo decoder 30 may code one or more syntax elements (e.g., such as theabove-described flag) at one of the slice, PPS, SPS, or VPS levelsspecifying whether the palette mode is enabled or disabled for theparticular slice, picture, sequence or the like, while the PLT_Mode_flagindicates whether the palette-based coding mode is used for each CU. Inthis case, if a flag or other syntax element sent at the slice, PPS, SPSor VPS level indicates that palette coding mode is disabled, in someexamples, there may be no need to signal the PLT_Mode_flag for each CU.Alternatively, if a flag or other syntax element sent at the slice, PPS,SPS or VPS level indicates that palette coding mode is enabled, thePLT_Mode_flag may be further signaled to indicate whether thepalette-based coding mode is to be used for each CU. Again, as mentionedabove, application of these techniques for indicating palette-basedcoding of a CU could additionally or alternatively be used to indicatepalette-based coding of a PU.

In some examples, the above-described syntax elements may beconditionally signaled in the bitstream. For example, video encoder 20and video decoder 30 may only encode or decode, respectively, the syntaxelements based on the size of the CU, the frame type, the color space,the color component, the frame size, the frame rate, the layer id inscalable video coding or the view id in multi-view coding.

While the examples described above relate to explicit signaling, e.g.,with one or more syntax elements in a bitstream, in other examples,video encoder 20 and/or video decoder 30 may implicitly determinewhether a palette coding mode is active and/or used for coding aparticular block. Video encoder 20 and video decoder 30 may determinewhether palette-based coding is used for a block based on, for example,the size of the CU, the frame type, the color space, the colorcomponent, the frame size, the frame rate, the layer id in scalablevideo coding or the view id in multi-view coding.

While the techniques of FIG. 4 are described above in the context of CUs(HEVC), it should be understood that the techniques may also be appliedto prediction units (PUs) or in other video coding processes and/orstandards.

FIG. 5 is a conceptual diagram illustrating an example of determiningindices to a palette for a block of pixels, consistent with techniquesof this disclosure. For example, FIG. 5 includes a map 240 of indexvalues (values 1, 2, and 3) that relate respective positions of pixelsassociated with the index values to an entry of palettes 244. Palettes244 may be determined in a similar manner as first palettes 184 andsecond palettes 192 described above with respect to FIG. 4.

Again, the techniques of FIG. 5 are described in the context of videoencoder 20 (FIG. 1 and FIG. 2) and video decoder 30 (FIG. 1 and FIG. 3)and with respect to the HEVC video coding standard for purposes ofexplanation. However, it should be understood that the techniques ofthis disclosure are not limited in this way, and may be applied by othervideo coding processors and/or devices in other video coding processesand/or standards.

While map 240 is illustrated in the example of FIG. 5 as including anindex value for each pixel position, it should be understood that inother examples, not all pixel positions may be associated with an indexvalue relating the pixel value to an entry of palettes 244. That is, asnoted above, in some examples, video encoder 20 may encode (and videodecoder 30 may obtain, from an encoded bitstream) an indication of anactual pixel value (or its quantized version) for a position in map 240if the pixel value is not included in palettes 244.

In some examples, video encoder 20 and video decoder 30 may beconfigured to code an additional map indicating which pixel positionsare associated with index values. For example, assume that the (i, j)entry in the map corresponds to the (i, j) position of a CU. Videoencoder 20 may encode one or more syntax elements for each entry of themap (i.e., each pixel position) indicating whether the entry has anassociated index value. For example, video encoder 20 may encode a flaghaving a value of one to indicate that the pixel value at the (i, j)location in the CU is one of the values in palettes 244. Video encoder20 may, in such an example, also encode a palette index (shown in theexample of FIG. 5 as values 1-3) to indicate that pixel value in thepalette and to allow video decoder to reconstruct the pixel value. Ininstances in which palettes 244 include a single entry and associatedpixel value, video encoder 20 may skip the signaling of the index value.Video encoder 20 may encode the flag to have a value of zero to indicatethat the pixel value at the (i, j) location in the CU is not one of thevalues in palettes 244. In this example, video encoder 20 may alsoencode an indication of the pixel value for use by video decoder 30 inreconstructing the pixel value. In some instances, the pixel value maybe coded in a lossy manner.

The value of a pixel in one position of a CU may provide an indicationof values of one or more other pixels in other positions of the CU. Forexample, there may be a relatively high probability that neighboringpixel positions of a CU will have the same pixel value or may be mappedto the same index value (in the case of lossy coding, in which more thanone pixel value may be mapped to a single index value).

Accordingly, according to aspects of this disclosure, video encoder 20may encode one or more syntax elements indicating a number ofconsecutive pixels or index values in a given scan order that have thesame pixel value or index value. As noted above, the string oflike-valued pixel or index values may be referred to herein as a run. Inan example for purposes of illustration, if two consecutive pixels orindices in a given scan order have different values, the run is equal tozero. If two consecutive pixels or indices in a given scan order havethe same value but the third pixel or index in the scan order has adifferent value, the run is equal to one. For three consecutive indicesor pixels with the same value, the run is two, and so forth. Videodecoder 30 may obtain the syntax elements indicating a run from anencoded bitstream and use the data to determine the number ofconsecutive locations that have the same pixel or index value.

In an example for purposes of illustration, consider line 248 of map240. Assuming a horizontal, left to right scan direction, line 248includes five index values of “2” and three index values of “3.”According to aspects of this disclosure, video encoder 20 may encode anindex value of 2 for the first position of line 248 in the scandirection. In addition, video encoder 20 may encode one or more syntaxelements indicating the run of consecutive values in the scan directionthat have the same index value as the signaled index value. In theexample of line 248, video encoder 20 may signal a run of 4, therebyindicating that the index values of the following four positions in thescan direction share the same index value as the signaled index value.Video encoder 20 may perform the same process for the next differentindex value in line 248. That is, video encoder 20 may encode an indexvalue of 3 and one or more syntax elements indicating a run of two.Video decoder 30 may obtain the syntax elements indicating the indexvalue and the number of consecutive indices in the scan direction havingthe same index value (the run).

As noted above, the indices of a map are scanned in a particular order.According to aspects of this disclosure, the scan direction may bevertical, horizontal, or at a diagonal (e.g., 45 degrees or 135 degreesdiagonally in block). In some examples, video encoder 20 may encode oneor more syntax elements for each block indicating a scan direction forscanning the indices of the block. Additionally or alternatively, thescan direction may be signaled or inferred based on so-called sideinformation such as, for example, block size, color space, and/or colorcomponent. Video encoder 20 may specify scans for each color componentof a block. Alternatively, a specified scan may apply to all colorcomponents of a block.

For example, with respect to a column based scan, consider column 252 ofmap 240. Assuming a vertical, top to bottom scan direction, column 252includes six index values of “2” and two index values of “3.” Accordingto aspects of this disclosure, video encoder 20 may encode an indexvalue of 2 for the first position of line 252 in the scan direction (atthe relative top of column 252). In addition, video encoder 20 maysignal a run of 5, thereby indicating that the index values of thefollowing five positions in the scan direction share the same indexvalue as the signaled index value. Video encoder 20 may also encode anindex value of 3 for the next position in the scan direction and one ormore syntax elements indicating a run of one. Video decoder 30 mayobtain the syntax elements indicating the index value and the number ofconsecutive indices in the scan direction having the same index value(the run).

According to aspects of this disclosure, video encoder 20 and videodecoder 30 may additionally or alternatively perform line copying forone or more entries of map 240. The line copying may depend, in someexamples, on the scan direction. For example, video encoder 20 mayindicate that a pixel or index value for a particular entry in a map isequal to a pixel or index value in a line above the particular entry(for a horizontal scan) or the column to the left of the particularentry (for a vertical scan). Video encoder 20 may also indicate, as arun, the number of pixel or index values in the scan order that areequal to the entry in the line above or the column to the left of theparticular entry. In this example, video encoder 20 and or video decoder30 may copy pixel or index values from the specified neighboring lineand from the specified number of entries for the line of the mapcurrently being coded.

In an example for purposes of illustration, consider columns 256 and 260of map 240. Assuming a vertical, top to bottom scan direction, column256 includes three index values of “1,” three index values of “2,” andtwo index values of “3.” Column 260 includes the same index valueshaving the same order in the scan direction. According to aspects ofthis disclosure, video encoder 20 may encode one or more syntax elementsfor column 260 indicating that the entire column 260 is copied fromcolumn 256. The one or more syntax elements may be associated with afirst entry of column 260 at the relative top of map 240. Video decoder30 may obtain the syntax elements indicating the line copying and copythe index values of column 256 for column 260 when decoding column 260.

According to aspects of this disclosure, the techniques for codingso-called runs of entries may be used in conjunction with the techniquesfor line copying described above. For example, video encoder 20 mayencode one or more syntax elements (e.g., a flag) indicating whether thevalue of an entry in a map is obtained from a palette or the value of anentry in the map is obtained from a previously coded line in map 240.Video encoder 20 may also encode one or more syntax elements indicatingan index value of a palette or the location of the entry in the line(the row or column). Video encoder 20 may also encode one or more syntaxelements indicating a number of consecutive entries that share the samevalue. Video decoder 30 may obtain such information from an encodedbitstream and use the information to reconstruct the map and pixelvalues for a block.

In an example for purposes of illustration, consider rows 264 and 268 ofmap 240. Assuming a horizontal, left to right scan direction, row 264includes three index values of “1,” two index values of “2,” and threeindex values of “3.” Row 268 includes five index values of “1” and threeindex values of “3.” In this example, video encoder 20 may identifyparticular entries of row 264 followed by a run when encoding data forrow 268. For example, video encoder 20 may encode one or more syntaxelements indicating that the first position of row 268 (the left mostposition of row 268) is the same as the first position of row 264. Videoencoder 20 may also encode one or more syntax elements indicating thatthe next run of two consecutive entries in the scan direction in row 268are the same as the first position of row 264.

In some examples, video encoder 20 may also determine whether to codethe current pixel or index value relative to a position in another row(or column) or to code the current pixel or index value using a runsyntax element. For example, after encoding the one or more syntaxelements indicating the first position of row 264 and the run of twoentries (noted above), video encoder 20 may encode, for the fourth andfifth positions in line 268 (from left to right), one or more syntaxelements indicating a value of 1 for the fourth position and one or moresyntax elements indicating a run of 1. Hence, video encoder 20 encodesthese two positions without reference to another line (or column). Videoencoder 20 may then code the first position having an index value of 3in row 268 relative to upper row 264 (e.g., indicating a copy from upperrow 264 and the run of consecutive positions in the scan order havingthe same index value). Accordingly, according to aspects of thisdisclosure, video encoder 20 may select between coding pixel or indexvalues of a line (or column) relative to other values of the line (orcolumn), e.g., using a run, coding pixel or index values of a line (orcolumn) relative to values of another line (or column), or a combinationthereof. Video encoder 20 may, in some examples, perform arate/distortion optimization to make the selection.

Video decoder 30 may receive the syntax elements described above andreconstruct row 268. For example, video decoder 30 may obtain dataindicating a particular location in a neighboring row from which to copythe associated index value for the position of map 240 currently beingcoded. Video decoder 30 may also obtain data indicating the number ofconsecutive positions in the scan order having the same index value.

In some instances, the line from which entries are copied may bedirectly adjacent to the entry of the line currently being coded (asillustrated in the examples of FIG. 5). However, in other examples, anumber of lines may be buffered by video encoder 20 and/or video decoder30, such that any of the number of lines of the map may be used aspredictive entries for a line of the map currently being coded. Hence,in some examples, the pixel value for an entry may be signaled to beequal to a pixel value of an entry in a row immediately above (or columnto the left of) or two or more rows above (or column to the left of) thecurrent row.

In an example for purposes of illustration, video encoder 20 and/orvideo decoder 30 may be configured to store the previous n rows ofentries prior to coding a current row of entries. In this example, videoencoder 20 may indicate the predictive row (the row from which entriesare copied) in a bitstream with a truncated unary code or other codes.In another example, video encoder 20 may encode (and video decoder 30may decode) a displacement value between the current line and thepredictive line of map 240 used as a reference for coding the currentline. That is, video encoder 20 may encode an indication of a particularline (or column) from which an index value is copied. In some examples,the displacement value may be a displacement vector. That is, let c[0],c[1], . . . , denote the indices of the current line of map 240 and letu[0], u[1], u[2], . . . , denote the indices of a predictive line of map240, such as an upper neighboring line. In this example, given adisplacement vector is d, the index value for c[i] may be predicted fromu[i+d]. The value of d may be coded using unary, truncated unary,exponential Golomb or Golomb-Rice codes.

FIG. 6 is a flowchart illustrating an example process for coding videodata using a palette coding mode, consistent with techniques of thisdisclosure. The method of FIG. 6 is explained with respect to a videocoder, such as video encoder 20 (FIGS. 1 and 2) or video decoder 30(FIGS. 1 and 3). However, it should be understood that other videocoding devices may be configured to perform a similar method. Moreover,certain steps in the method may be performed in a different order or inparallel. Likewise, certain steps may be omitted, and other steps may beadded, in various examples.

A video coder, such as video encoder and/or video decoder 30 mayinitially determine whether a mode for coding a current block of videodata is a palette-based coding mode (280). As noted above, one or moresyntax elements may be included in a bitstream indicating a coding modeof the current block (e.g., a PLT_Mode_flag syntax element). In otherexamples, the video coder may make a determination based on so-calledside information, as noted above.

In any case, if a palette-based coding mode is not used for the blockcurrently being coded (the “no” branch of step 280), the video coder maycode the block of video data using a mode other than a palette-basedcoding mode (282). For example, the video coder may code the block ofvideo data using a non-palette-based mode, such as an intra-mode, aninter-mode, or another coding mode.

If a palette-based coding mode is used for the block currently beingcoded (the “yes” branch of step 280), the video coder may determine apalette for coding the current block (284). As described with respect toFIGS. 7 and 8 below, in some examples, the video coder may determine thepalette for the current block based on a palette associated with one ormore other, previously coded blocks of video data.

The video coder may also determine index values for the block currentlybeing coded (286). For example, as described with greater detail withrespect to FIG. 9 below, the video coder may determine a map thatindicates which pixel positions of the block are coded using an indexvalue that relates a position of a pixel to an entry of the determinedpalette having an associated pixel value. In some instances, the videocoder may determine one or more index values relative to other indexvalues of the block. For example, the video coder may determine a run ofindex values and/or an index value based on an index value located inanother line or column of the block.

The video coder then codes the video data of the block using thedetermined palette and index values (280). For example, with respect tovideo encoder 20, video encoder 20 may encode data indicating thepalette as well as the index values in an encoded bitstream. Videoencoder 20 may also encode, for any pixel positions not having acorresponding pixel in the determined palette, the actual pixel valuesor their quantized versions at such positions. Video decoder 30 mayparse and decode the palette, index values, and pixel values from anencoded bitstream and use the data to reconstruct the block of videodata.

FIG. 7 is a flowchart illustrating an example process for determining apalette in palette-based coding, consistent with techniques of thisdisclosure. The method of FIG. 7 is explained with respect to a videocoder, such as video encoder 20 (FIGS. 1 and 2) or video decoder 30(FIGS. 1 and 3). However, it should be understood that other videocoding devices may be configured to perform a similar method. Moreover,certain steps in the method may be performed in a different order or inparallel. Likewise, certain steps may be omitted, and other steps may beadded, in various examples. In some examples, the techniques of FIG. 7may be performed during step 284 of FIG. 6.

In the example of FIG. 7, the video coder may determine a size of thepalette (300). In some examples, the size of the palette may be fixed.In other examples, the size of the palette may be dynamically adjustedduring coding (e.g., by adding or removing entries from the palette).The video coder may code one or more syntax elements indicating the sizeof the palette.

The video coder may determine whether the palette for coding the currentblock is predicted from one or more other, previously coded palettes(302). If the palette is predicted (the yes branch of step 302), thevideo coder may determine the predictive palette (304). For example,video encoder 20 may encode data indicating that the palette for thecurrent block is based on one or more previously encoded palettes, aswell as data indicating a location of a block associated with thepredictive palette (or identifying the predictive palette itself).Likewise, video decoder 30 may obtain such data from an encodedbitstream. As described above with respect to FIG. 4, the predictivepalette may be associated with a neighboring block of the blockcurrently being coded.

The video coder may determine one or more entries of the palette forcoding the current block based on one or more entries of the determinedpredictive palette (306). In some examples, the video coder may copy anentire palette from another block for coding the current block. In otherexamples, the video coder may selectively copy entries from anotherpalette. The palette prediction may be based, in some examples, based ona frequency with which palette entries are used in one or morepreviously coded blocks.

The video coder may also determine one or more non-predicted entries ofthe palette (308). For example, in some instances, only a portion of apalette may be predicted from other previously coded palettes. In otherinstances, a palette may not be predictively coded at all. In suchinstances, the video coder may determine palette entries without (orafter) performing the palette prediction techniques described herein.

FIG. 8 is a flowchart illustrating an example process for determiningindices of a block of video data, consistent with techniques of thisdisclosure. The method of FIG. 8 is explained with respect to a videocoder, such as video encoder 20 (FIGS. 1 and 2) or video decoder 30(FIGS. 1 and 3). However, it should be understood that other videocoding devices may be configured to perform a similar method. Moreover,certain steps in the method may be performed in a different order or inparallel. Likewise, certain steps may be omitted, and other steps may beadded, in various examples. In some examples, the techniques of FIG. 8may be performed during step 286 of FIG. 6.

The video coder may initially determine a scan direction, e.g., forscanning a map of index values in palette based coding (320). In someexamples, as noted above with respect to the example of FIG. 5, thevideo coder may be preconfigured to use a particular scan direction. Inother examples, the video coder may code one or more syntax elementsindicating the scan direction and determine the scan direction based onthe syntax elements. In still other examples, the video coder maydetermine the scan direction based on so-called side information.

The video coder may also determine a map of positions of the block ofvideo data currently being coded that have associated index values of apalette. For example, one or more pixel values of the block currentlybeing coded may not be represented in the palette from the block. Insuch examples, the video coder may code the pixel values directly(rather than coding an index value that identifies the pixel value inthe palette). The map may indicate which pixel positions are associatedwith an index value and which pixel positions are not associated with anindex value.

The video coder determines one or more first index values (324). For agiven pixel in the block, the video coder may determine an index valuethat relates the pixel value of the given pixel to an entry in thepalette for the block.

The video coder also determines one or more second index values based onthe first index values (326). For example, as described above withrespect to FIG. 5, the video coder may determine one or more indexvalues relative to other already coded index values. In some examples,the video coder may determine second index values based on a run ofconsecutive same-valued index values. In other examples, the video codermay determine second index values based on one or more first indexvalues included in a different line than the line of pixels currentlybeing coded. In other examples, the video coder may apply a combinationof techniques to determine the second index values.

It is to be recognized that depending on the example, certain acts orevents of any of the techniques described herein can be performed in adifferent sequence, may be added, merged, or left out altogether (e.g.,not all described acts or events are necessary for the practice of thetechniques). Moreover, in certain examples, acts or events may beperformed concurrently, e.g., through multi-threaded processing,interrupt processing, or multiple processors, rather than sequentially.In addition, while certain aspects of this disclosure are described asbeing performed by a single module or unit for purposes of clarity, itshould be understood that the techniques of this disclosure may beperformed by a combination of units or modules associated with a videocoder.

Certain aspects of this disclosure have been described with respect tothe developing HEVC standard for purposes of illustration. However, thetechniques described in this disclosure may be useful for other videocoding processes, including other standard or proprietary video codingprocesses not yet developed.

The techniques described above may be performed by video encoder 20(FIGS. 1 and 2) and/or video decoder 30 (FIGS. 1 and 3), both of whichmay be generally referred to as a video coder. Likewise, video codingmay refer to video encoding or video decoding, as applicable.

While particular combinations of various aspects of the techniques aredescribed above, these combinations are provided merely to illustrateexamples of the techniques described in this disclosure. Accordingly,the techniques of this disclosure should not be limited to these examplecombinations and may encompass any conceivable combination of thevarious aspects of the techniques described in this disclosure.

In one or more examples, the functions described may be implemented inhardware, software, firmware, or any combination thereof. If implementedin software, the functions may be stored on or transmitted over, as oneor more instructions or code, a computer-readable medium and executed bya hardware-based processing unit. Computer-readable media may includecomputer-readable storage media, which corresponds to a tangible mediumsuch as data storage media, or communication media including any mediumthat facilitates transfer of a computer program from one place toanother, e.g., according to a communication protocol. In this manner,computer-readable media generally may correspond to (1) tangiblecomputer-readable storage media which is non-transitory or (2) acommunication medium such as a signal or carrier wave. Data storagemedia may be any available media that can be accessed by one or morecomputers or one or more processors to retrieve instructions, codeand/or data structures for implementation of the techniques described inthis disclosure. A computer program product may include acomputer-readable medium.

By way of example, and not limitation, such computer-readable storagemedia can comprise RAM, ROM, EEPROM, CD-ROM or other optical diskstorage, magnetic disk storage, or other magnetic storage devices, flashmemory, or any other medium that can be used to store desired programcode in the form of instructions or data structures and that can beaccessed by a computer. Also, any connection is properly termed acomputer-readable medium. For example, if instructions are transmittedfrom a website, server, or other remote source using a coaxial cable,fiber optic cable, twisted pair, digital subscriber line (DSL), orwireless technologies such as infrared, radio, and microwave, then thecoaxial cable, fiber optic cable, twisted pair, DSL, or wirelesstechnologies such as infrared, radio, and microwave are included in thedefinition of medium. It should be understood, however, thatcomputer-readable storage media and data storage media do not includeconnections, carrier waves, signals, or other transient media, but areinstead directed to non-transient, tangible storage media. Disk anddisc, as used herein, includes compact disc (CD), laser disc, opticaldisc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wheredisks usually reproduce data magnetically, while discs reproduce dataoptically with lasers. Combinations of the above should also be includedwithin the scope of computer-readable media.

Instructions may be executed by one or more processors, such as one ormore digital signal processors (DSPs), general purpose microprocessors,application specific integrated circuits (ASICs), field programmablelogic arrays (FPGAs), or other equivalent integrated or discrete logiccircuitry. Accordingly, the term “processor,” as used herein may referto any of the foregoing structure or any other structure suitable forimplementation of the techniques described herein. In addition, in someaspects, the functionality described herein may be provided withindedicated hardware and/or software modules configured for encoding anddecoding, or incorporated in a combined codec. Also, the techniquescould be fully implemented in one or more circuits or logic elements.

The techniques of this disclosure may be implemented in a wide varietyof devices or apparatuses, including a wireless handset, an integratedcircuit (IC) or a set of ICs (e.g., a chip set). Various components,modules, or units are described in this disclosure to emphasizefunctional aspects of devices configured to perform the disclosedtechniques, but do not necessarily require realization by differenthardware units. Rather, as described above, various units may becombined in a codec hardware unit or provided by a collection ofinteroperative hardware units, including one or more processors asdescribed above, in conjunction with suitable software and/or firmware.

Various examples have been described. These and other examples arewithin the scope of the following claims.

What is claimed is:
 1. A method of coding video data, the methodcomprising: determining a first index value associated with a firstpixel in a block of the video data, wherein the first index valuerelates a position of the first pixel to an entry of a palette of pixelvalues; determining, based on the first index value, one or more secondindex values associated with one or more second pixels in the block ofvideo data, wherein the second index values relate the positions of theone or more second pixels to one or more entries of the palette of pixelvalues; and coding the first pixel and the one or more second pixels ofthe block of video data.
 2. The method of claim 1, wherein the one ormore second index values comprise a plurality of second indices, themethod further comprising: coding one or more syntax elements indicatinga run of a number of indices in the plurality of second indices that arebased on the first index value.
 3. The method of claim 2, wherein theplurality of second indices comprise a plurality of consecutive secondindices in a predetermined scan direction.
 4. The method of claim 1, themethod further comprising: determining a map of index values for theblock of video data including the first index value and the one or moresecond index values; and coding one or more syntax elements indicatingwhether one or more pixel values of one or more respective pixelpositions in the block is included in the palette of pixel values. 5.The method of claim 1, wherein determining the one or more second indexvalues based on the first index value comprises coding one or moresyntax elements indicating a line of pixel positions of the block ofvideo data that includes the first index value.
 6. The method of claim5, wherein the line of pixel positions comprises a row, a portion of arow, a column or a portion of a column of pixel positions of the blockof video data.
 7. The method of claim 5, wherein coding the one or moresyntax elements indicating the line comprises coding data identifying alocation of the line in the block of video data.
 8. The method of claim7, wherein the data identifying the location of the line comprises adisplacement value identifying the row in the block of video data. 9.The method of claim 7, wherein coding the one or more syntax elementsindicating the line comprises coding the one or more syntax elementsusing one of a unary and a truncated unary code.
 10. The method of claim5, further comprising: when the one or more second index values arebased on the first index value and the one or more syntax elementsindicate the line are coded, coding data indicating a run of a number ofindices that are based on the first index value; determining one or morethird index values that are not based on the first index value includingcoding one or more syntax elements indicating an entry in the palettefor the one or more third index values and coding data indicating a runof a number of indices that are based on the entry in the palette. 11.The method of claim 1, further comprising: determining a map of indexvalues for the block of video data including the first index value andthe one or more second index values; and coding data indicating scandirection for coding the index values of the map.
 12. The method ofclaim 1, further comprising: determining that the block of video data iscoded using a palette coding mode based on one or more of coding dataindicating that the block of video data is coded with a palette codingmode and inferring palette coding mode information based on one or moreof a size of the coding block, a frame type, a color space, a colorcomponent, a frame size, a frame rate, a layer id in scalable videocoding or a view id in multi-view coding.
 13. The method of claim 1,wherein coding the first pixel and one or more second pixels of theblock comprises decoding the pixels, and wherein decoding the pixelscomprises: determining values for the one more pixels by matchingrespective index values of the first pixel and one or more second pixelsto at least one entry of the palette.
 14. The method of claim 1, whereincoding the first pixel and one or more second pixels of the blockcomprises encoding the pixels, and wherein encoding the pixels comprisesencoding the first index value and one or more second index values in anencoded bitstream.
 15. An apparatus for coding video data, the apparatuscomprising: a memory storing the video data; and one or more processorsconfigured to: determine a first index value associated with a firstpixel in a block of the video data, wherein the first index valuerelates a position of the first pixel to an entry of a palette of pixelvalues; determine, based on the first index value, one or more secondindex values associated with one or more second pixels in the block ofvideo data, wherein the second index values relate the positions of theone or more second pixels to one or more entries of the palette of pixelvalues; and code the first pixel and the one or more second pixels ofthe block of video data.
 16. The apparatus of claim 15, wherein the oneor more second index values comprise a plurality of second indices,wherein the one or more processors are further configured to code one ormore syntax elements indicating a run of a number of indices in theplurality of second indices that are based on the first index value. 17.The apparatus of claim 16, wherein the plurality of second indicescomprise a plurality of consecutive second indices in a predeterminedscan direction.
 18. The apparatus of claim 15, wherein the one or moreprocessors are further configured to: determine a map of index valuesfor the block of video data including the first index value and the oneor more second index values; and code one or more syntax elementsindicating whether one or more pixel values of one or more respectivepixel positions in the block is included in the palette of pixel values.19. The apparatus of claim 15, wherein to determine the one or moresecond index values based on the first index value, the one or moreprocessors are configured to code one or more syntax elements indicatinga line of pixel positions of the block of video data that includes thefirst index value.
 20. The apparatus of claim 19, wherein the line ofpixel positions comprises a row, a portion of a row, a column or aportion of a column of pixel positions of the block of video data. 21.The apparatus of claim 19, wherein to code the one or more syntaxelements indicating the line, the one or more processors are configuredto code data identifying a location of the line in the block of videodata.
 22. The apparatus of claim 21, wherein the data identifying thelocation of the line comprises a displacement value identifying the rowin the block of video data.
 23. The apparatus of claim 21, wherein tocode the one or more syntax elements indicating the line, the one ormore processors are configured to code the one or more syntax elementsusing one of a unary and a truncated unary code.
 24. The apparatus ofclaim 19, wherein the one or more processors are further configured to:when the one or more second index values are based on the first indexvalue and the one or more syntax elements indicate the line are coded,code data indicating a run of a number of indices that are based on thefirst index value; determine one or more third index values that are notbased on the first index value including coding one or more syntaxelements indicating an entry in the palette for the one or more thirdindex values and coding data indicating a run of a number of indicesthat are based on the entry in the palette.
 25. The apparatus of claim15, wherein the one or more processors are further configured to:determine a map of index values for the block of video data includingthe first index value and the one or more second index values; and codedata indicating scan direction for coding the index values of the map.26. The apparatus of claim 15, wherein the one or more processors arefurther configured to determine that the block of video data is codedusing a palette coding mode based on one or more of coding dataindicating that the block of video data is coded with a palette codingmode and inferring palette coding mode information based on one or moreof a size of the coding block, a frame type, a color space, a colorcomponent, a frame size, a frame rate, a layer id in scalable videocoding or a view id in multi-view coding.
 27. The apparatus of claim 15,wherein to code the first pixel and one or more second pixels of theblock, the one or more processors are configured to decode the pixels,and wherein to decode the pixels, the one or more processors areconfigured to: determine values for the one more pixels by matchingrespective index values of the first pixel and one or more second pixelsto at least one entry of the palette.
 28. The apparatus of claim 15,wherein to code the first pixel and one or more second pixels of theblock, the one or more processors are configured to encode the pixels,and wherein to encode the pixels, the one or more processors areconfigured to encode the first index value and one or more second indexvalues in an encoded bitstream.
 29. An apparatus for coding video data,the apparatus comprising: means for determining a first index valueassociated with a first pixel in a block of the video data, wherein thefirst index value relates a position of the first pixel to an entry of apalette of pixel values; means for determining, based on the first indexvalue, one or more second index values associated with one or moresecond pixels in the block of video data, wherein the second indexvalues relate the positions of the one or more second pixels to one ormore entries of the palette of pixel values; and means for coding thefirst pixel and the one or more second pixels of the block of videodata.
 30. A non-transitory computer-readable medium storing instructionsthereon that, when executed, cause one or more processors to: determinea first index value associated with a first pixel in a block of thevideo data, wherein the first index value relates a position of thefirst pixel to an entry of a palette of pixel values; determine, basedon the first index value, one or more second index values associatedwith one or more second pixels in the block of video data, wherein thesecond index values relate the positions of the one or more secondpixels to one or more entries of the palette of pixel values; and codethe first pixel and the one or more second pixels of the block of videodata.